From c80b79fec0c9ce96c08076b38f0a1acda2fc6d3f Mon Sep 17 00:00:00 2001 From: diehard67 <52913073+diehard67@users.noreply.github.com> Date: Fri, 23 Aug 2019 16:48:38 -0600 Subject: [PATCH] change to uniput to report events right away added code to report key events right away rather than reporting them after you pressed several keys. I was getting key events in bunches of 4 all at once. --- drv_G15.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drv_G15.c b/drv_G15.c index 6bc6415..50cda2c 100644 --- a/drv_G15.c +++ b/drv_G15.c @@ -106,6 +106,13 @@ void drv_G15_keyDown(unsigned char scancode) event.code = scancode; event.value = 1; write(uinput_fd, &event, sizeof(event)); + +/* hopefully this makes the system report the keys */ + + event.type = EV_SYN; + event.code = SYN_REPORT; + event.value = 0; + write(uinput_fd, &event, sizeof(event)); } void drv_G15_keyUp(unsigned char scancode) @@ -117,6 +124,13 @@ void drv_G15_keyUp(unsigned char scancode) event.code = scancode; event.value = 0; write(uinput_fd, &event, sizeof(event)); + +/* hopefully this makes the system report the keys */ + + event.type = EV_SYN; + event.code = SYN_REPORT; + event.value = 0; + write(uinput_fd, &event, sizeof(event)); } void drv_G15_keyDownUp(unsigned char scancode)