From 4964c59b20a5dd9cd9978afe2c083951470841b5 Mon Sep 17 00:00:00 2001 From: jeon Date: Tue, 12 May 2020 19:38:59 +0900 Subject: [PATCH] e_info_server_input: adjust keybits to avoid buttons - 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 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/bin/e_info_server_input.c b/src/bin/e_info_server_input.c index e55dae3298..1248ae1497 100644 --- a/src/bin/e_info_server_input.c +++ b/src/bin/e_info_server_input.c @@ -4,6 +4,16 @@ #include +#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); -- 2.34.1