e_info_server_input: adjust keybits to avoid buttons 32/233132/1
authorjeon <jhyuni.kang@samsung.com>
Tue, 12 May 2020 10:38:59 +0000 (19:38 +0900)
committerjeon <jhyuni.kang@samsung.com>
Tue, 12 May 2020 10:39:01 +0000 (19:39 +0900)
  - if set button bits, keyboard device has capability of  mouse/joystick
  - if kernel version is lower, some keybits are not defined

Change-Id: I65d28fd31091a7817b0c9df0f5b4fd90c93874ce

src/bin/e_info_server_input.c

index e55dae3..1248ae1 100644 (file)
@@ -4,6 +4,16 @@
 
 #include <linux/uinput.h>
 
+#ifndef KEY_LIGHTS_TOGGLE
+#define KEY_LIGHTS_TOGGLE 0x21e
+#endif
+#ifndef KEY_ALS_TOGGLE
+#define KEY_ALS_TOGGLE 0x230
+#endif
+#ifndef KEY_ONSCREEN_KEYBOARD
+#define KEY_ONSCREEN_KEYBOARD 0x278
+#endif
+
 typedef struct _E_Info_Server_Input
 {
    struct
@@ -39,7 +49,11 @@ _e_info_input_create_keyboard_device(const char *dev_name)
    ioctl(fd_uinput, UI_SET_EVBIT, EV_SYN);
    ioctl(fd_uinput, UI_SET_EVBIT, EV_MSC);
 
-   for (i = KEY_ESC; i <= KEY_MAX; i++)
+   for (i = KEY_ESC; i <= KEY_MICMUTE; i++)
+     ioctl(fd_uinput, UI_SET_KEYBIT, i);
+   for (i = KEY_OK; i <= KEY_LIGHTS_TOGGLE; i++)
+     ioctl(fd_uinput, UI_SET_KEYBIT, i);
+   for (i = KEY_ALS_TOGGLE; i <= KEY_ONSCREEN_KEYBOARD; i++)
      ioctl(fd_uinput, UI_SET_KEYBIT, i);
 
    ioctl(fd_uinput, UI_SET_MSCBIT, MSC_SCAN);