summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-02-03 15:29:47 -0500
committerChris Michael <cp.michael@samsung.com>2015-02-03 15:31:17 -0500
commiteedd6c3159b7a1fa736cd727e808edb4bbc6b997 (patch)
treef41f6843318a545b2f2ad67e941ec4c838e92812
parent1097a823657f3659882e9258af5da7c7e500c28b (diff)
downloadefl-eedd6c3159b7a1fa736cd727e808edb4bbc6b997.tar.gz
ecore-wayland: Don't send key repeat events for keys which should not
get them Summary: Some keys in certain keyboard layouts should not be repeated so add a test which uses xkb to inform us if this key supports repeating. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index 76d115dc9a..32f7e55b55 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -812,7 +812,6 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
e->window = win->id;
e->event_window = win->id;
e->timestamp = timestamp;
-
e->modifiers = input->modifiers;
if (state)
@@ -820,6 +819,8 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
else
ecore_event_add(ECORE_EVENT_KEY_UP, e, NULL, NULL);
+ if (!xkb_keymap_key_repeats(input->xkb.keymap, keycode)) return;
+
if ((!state) && (keycode == input->repeat.key))
{
input->repeat.sym = 0;
@@ -854,13 +855,15 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E
if (!(input = data)) return;
- input->modifiers = 0;
- if (!input->xkb.state) return;
+ if (!input->xkb.keymap) return;
xkb_state_update_mask(input->xkb.state,
depressed, latched, locked, 0, 0, group);
+
mask = xkb_state_serialize_mods(input->xkb.state,
(XKB_STATE_DEPRESSED | XKB_STATE_LATCHED));
+
+ input->modifiers = 0;
if (mask & input->xkb.control_mask)
input->modifiers |= ECORE_EVENT_MODIFIER_CTRL;
if (mask & input->xkb.alt_mask)