summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland
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 /src/lib/ecore_wayland
parent1097a823657f3659882e9258af5da7c7e500c28b (diff)
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>
Diffstat (limited to 'src/lib/ecore_wayland')
-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 76d115d..32f7e55 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
812 e->window = win->id; 812 e->window = win->id;
813 e->event_window = win->id; 813 e->event_window = win->id;
814 e->timestamp = timestamp; 814 e->timestamp = timestamp;
815
816 e->modifiers = input->modifiers; 815 e->modifiers = input->modifiers;
817 816
818 if (state) 817 if (state)
@@ -820,6 +819,8 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
820 else 819 else
821 ecore_event_add(ECORE_EVENT_KEY_UP, e, NULL, NULL); 820 ecore_event_add(ECORE_EVENT_KEY_UP, e, NULL, NULL);
822 821
822 if (!xkb_keymap_key_repeats(input->xkb.keymap, keycode)) return;
823
823 if ((!state) && (keycode == input->repeat.key)) 824 if ((!state) && (keycode == input->repeat.key))
824 { 825 {
825 input->repeat.sym = 0; 826 input->repeat.sym = 0;
@@ -854,13 +855,15 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E
854 855
855 if (!(input = data)) return; 856 if (!(input = data)) return;
856 857
857 input->modifiers = 0; 858 if (!input->xkb.keymap) return;
858 if (!input->xkb.state) return;
859 859
860 xkb_state_update_mask(input->xkb.state, 860 xkb_state_update_mask(input->xkb.state,
861 depressed, latched, locked, 0, 0, group); 861 depressed, latched, locked, 0, 0, group);
862
862 mask = xkb_state_serialize_mods(input->xkb.state, 863 mask = xkb_state_serialize_mods(input->xkb.state,
863 (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED)); 864 (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED));
865
866 input->modifiers = 0;
864 if (mask & input->xkb.control_mask) 867 if (mask & input->xkb.control_mask)
865 input->modifiers |= ECORE_EVENT_MODIFIER_CTRL; 868 input->modifiers |= ECORE_EVENT_MODIFIER_CTRL;
866 if (mask & input->xkb.alt_mask) 869 if (mask & input->xkb.alt_mask)