From 7106f590585ff152e891d74c079c43e187170873 Mon Sep 17 00:00:00 2001 From: Nevyn Hira Date: Tue, 20 Apr 2021 23:37:55 +1200 Subject: [PATCH 1/3] Fix "KeyCode" within "KeyEvent" object --- events.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events.go b/events.go index f4299b6..c197b0f 100644 --- a/events.go +++ b/events.go @@ -35,14 +35,14 @@ const ( type KeyEvent struct { Event *InputEvent Scancode uint16 - Keycode uint16 + Keycode string State KeyEventState } func (kev *KeyEvent) New(ev *InputEvent) { kev.Event = ev - kev.Keycode = 0 // :todo kev.Scancode = ev.Code + kev.Keycode = KEY[int(ev.Code)] switch ev.Value { case 0: From 3db1b3ea16fe54e6c799617d51a1ecf36d4fb791 Mon Sep 17 00:00:00 2001 From: Nevyn Hira Date: Sat, 15 May 2021 09:59:40 +1200 Subject: [PATCH 2/3] Update README.rst --- README.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.rst b/README.rst index c66c29b..e95add5 100644 --- a/README.rst +++ b/README.rst @@ -11,3 +11,19 @@ Documentation: Development: https://github.com/gvalkov/golang-evdev + +*Fork Notes:* +------------- + +The only changes between this and the original project (thus far) is +the keycode which is problematic. It works if you assume a particular +layout (maybe). The change is similar to some code in evdev-python. + +One of two things needs to happen: +* The keycode is looked up in the keymap. I have no idea how to do + this. +* Keymap is stored as an array of possible codes requiring a compare + function. This is problematic in that any scancode can + theorhetically produce any keycode depending on layout and really + this just then becomes about the meaningful probability of a key + presenting a particular character/keycode. From b363cbfcc4c48bf1eb8a7daa1c2bc3283499487f Mon Sep 17 00:00:00 2001 From: Nevyn Hira Date: Sat, 15 May 2021 10:00:02 +1200 Subject: [PATCH 3/3] Update README.rst --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index e95add5..33489f6 100644 --- a/README.rst +++ b/README.rst @@ -20,6 +20,7 @@ the keycode which is problematic. It works if you assume a particular layout (maybe). The change is similar to some code in evdev-python. One of two things needs to happen: + * The keycode is looked up in the keymap. I have no idea how to do this. * Keymap is stored as an array of possible codes requiring a compare