You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
575 B

  1. --- a/drv_G15.c
  2. +++ b/drv_G15.c
  3. @@ -42,6 +42,7 @@
  4. #include <usb.h>
  5. #include <fcntl.h>
  6. +#include <linux/version.h>
  7. #include <linux/input.h>
  8. #include <linux/uinput.h>
  9. @@ -269,8 +270,13 @@ void drv_G15_initKeyHandling(char *devic
  10. }
  11. memset(&device, 0, sizeof(device));
  12. strncpy(device.name, "G15 Keys", UINPUT_MAX_NAME_SIZE);
  13. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
  14. device.id.bustype = BUS_USB;
  15. device.id.version = 4;
  16. +#else
  17. + device.idbus = BUS_USB;
  18. + device.idversion = 4;
  19. +#endif
  20. ioctl(uinput_fd, UI_SET_EVBIT, EV_KEY);