From 55c0dbb3c8178e328b74e88f30679dec9b04c403 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 25 Nov 2013 07:35:13 +0000 Subject: [PATCH] Fix ecore wayland key events to fill in Ecore_Event_Key with X11-like values. Previously, the keyname and key fields of the Ecore_Event_Key structure were being filled in with the capitalized version of the key. This is due to xkb_keysym_get_name always returning keys with the modifier applied. There is no actual function in xkbcommon to Not do this :/ so we have to manually check if Shift is pressed, and if so then we need to convert the key to lowercase. Fixes T550 Signed-off-by: Chris Michael --- src/lib/ecore_wayland/ecore_wl_input.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index c686691..8e7255f 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c @@ -713,6 +713,16 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN if (keyname[0] == '\0') snprintf(keyname, sizeof(keyname), "Keycode-%u", code); + /* if shift is active, we need to transform the key to lower */ + if (xkb_state_mod_index_is_active(input->xkb.state, + xkb_map_mod_get_index(input->xkb.keymap, + XKB_MOD_NAME_SHIFT), + XKB_STATE_MODS_EFFECTIVE)) + { + if (keyname[0] != '\0') + keyname[0] = tolower(keyname[0]); + } + memset(compose, 0, sizeof(compose)); _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, compose, sizeof(compose)); -- 2.7.4