From 26251340e532e49c9d5732009d340919c4419375 Mon Sep 17 00:00:00 2001 From: Sleeplessy Date: Thu, 9 Nov 2017 15:01:34 +0800 Subject: [PATCH] fix the KeyUp fun the function KeyUp won't work due to the error state value.Fixed it by replacing it with "btnStateReleased". --- uinput.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uinput.go b/uinput.go index f9346bf..ae6d181 100644 --- a/uinput.go +++ b/uinput.go @@ -356,7 +356,7 @@ func (vk vKeyboard) KeyDown(key int) error { // cases it is recommended to call this function immediately after the "KeyDown" function in order to only issue a // single key press. func (vk vKeyboard) KeyUp(key int) error { - err := sendBtnEvent(vk.deviceFile, key, btnStatePressed) + err := sendBtnEvent(vk.deviceFile, key, btnStateReleased) if err != nil { return fmt.Errorf("Failed to issue the KeyUp event: %v", err) }