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 <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-11-25 07:35:13 +00:00
parent 39599d1a26
commit 55c0dbb3c8
1 changed files with 10 additions and 0 deletions

View File

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