summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-07-23 10:49:31 -0400
committerChris Michael <cp.michael@samsung.com>2015-07-23 11:54:24 -0400
commit79b33928fac89a1c33182d5dd6655eb687564463 (patch)
treeeda076b5f5c089cab52d5cce7a352f979e8049a3 /src/lib/ecore_drm
parent3d531fba1e747e71904ab71200462caea0835892 (diff)
ecore-drm: Ignore key events that are not seat wide state changes
Summary: This patch adds some checks to make sure that we can ignore key events which are not seat wide state changes. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index e40ad400b3..deca6a2c71 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -286,6 +286,7 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
286 uint32_t code, nsyms; 286 uint32_t code, nsyms;
287 const xkb_keysym_t *syms; 287 const xkb_keysym_t *syms;
288 enum libinput_key_state state; 288 enum libinput_key_state state;
289 int key_count;
289 xkb_keysym_t sym = XKB_KEY_NoSymbol; 290 xkb_keysym_t sym = XKB_KEY_NoSymbol;
290 char key[256], keyname[256], compose_buffer[256]; 291 char key[256], keyname[256], compose_buffer[256];
291 Ecore_Event_Key *e; 292 Ecore_Event_Key *e;
@@ -298,6 +299,12 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
298 timestamp = libinput_event_keyboard_get_time(event); 299 timestamp = libinput_event_keyboard_get_time(event);
299 code = libinput_event_keyboard_get_key(event) + 8; 300 code = libinput_event_keyboard_get_key(event) + 8;
300 state = libinput_event_keyboard_get_key_state(event); 301 state = libinput_event_keyboard_get_key_state(event);
302 key_count = libinput_event_keyboard_get_seat_key_count(event);
303
304 /* ignore key events that are not seat wide state changes */
305 if (((state == LIBINPUT_KEY_STATE_PRESSED) && (key_count != 1)) ||
306 ((state == LIBINPUT_KEY_STATE_RELEASED) && (key_count != 0)))
307 return;
301 308
302 xkb_state_update_key(edev->xkb.state, code, 309 xkb_state_update_key(edev->xkb.state, code,
303 (state ? XKB_KEY_DOWN : XKB_KEY_UP)); 310 (state ? XKB_KEY_DOWN : XKB_KEY_UP));