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>
This commit is contained in:
Chris Michael 2015-02-03 15:29:47 -05:00
parent 1097a82365
commit eedd6c3159
1 changed files with 6 additions and 3 deletions

View File

@ -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)