g15daemon-1.9.5.3-uinput.patch 947 B

123456789101112131415161718192021222324252627282930313233343536
  1. Index: g15daemon-1.9.5.3/g15daemon/g15_plugin_uinput.c
  2. ===================================================================
  3. --- g15daemon-1.9.5.3/plugins/g15_plugin_uinput.c
  4. +++ g15daemon-1.9.5.3/plugins/g15_plugin_uinput.c
  5. @@ -125,6 +125,14 @@
  6. event.value = G15KEY_DOWN;
  7. write (uinp_fd, &event, sizeof(event));
  8. +
  9. + /* Need to write sync event */
  10. + memset(&event, 0, sizeof(event));
  11. + event.type = EV_SYN;
  12. + event.code = SYN_REPORT;
  13. + event.value = 0;
  14. + write(uinp_fd, &event, sizeof(event));
  15. +
  16. }
  17. static void g15_uinput_keyup(unsigned char code)
  18. @@ -137,6 +145,14 @@
  19. event.value = G15KEY_UP;
  20. write (uinp_fd, &event, sizeof(event));
  21. +
  22. + /* Need to write sync event */
  23. + memset(&event, 0, sizeof(event));
  24. + event.type = EV_SYN;
  25. + event.code = SYN_REPORT;
  26. + event.value = 0;
  27. + write(uinp_fd, &event, sizeof(event));
  28. +
  29. }
  30. void (*keyup)(unsigned char code) = &g15_uinput_keyup;