diff options
author | Chris Michael <cp.michael@samsung.com> | 2013-11-25 07:35:13 +0000 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2013-11-25 07:38:00 +0000 |
commit | 55c0dbb3c8178e328b74e88f30679dec9b04c403 (patch) | |
tree | f698453c5be05d07ac8e36f798107478f7a0b002 /src/lib | |
parent | 39599d1a26dc874d5fdb9c40edf3db77e44807a8 (diff) |
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>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_input.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index c68669167d..8e7255f091 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 | |||
713 | if (keyname[0] == '\0') | 713 | if (keyname[0] == '\0') |
714 | snprintf(keyname, sizeof(keyname), "Keycode-%u", code); | 714 | snprintf(keyname, sizeof(keyname), "Keycode-%u", code); |
715 | 715 | ||
716 | /* if shift is active, we need to transform the key to lower */ | ||
717 | if (xkb_state_mod_index_is_active(input->xkb.state, | ||
718 | xkb_map_mod_get_index(input->xkb.keymap, | ||
719 | XKB_MOD_NAME_SHIFT), | ||
720 | XKB_STATE_MODS_EFFECTIVE)) | ||
721 | { | ||
722 | if (keyname[0] != '\0') | ||
723 | keyname[0] = tolower(keyname[0]); | ||
724 | } | ||
725 | |||
716 | memset(compose, 0, sizeof(compose)); | 726 | memset(compose, 0, sizeof(compose)); |
717 | _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, | 727 | _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, |
718 | compose, sizeof(compose)); | 728 | compose, sizeof(compose)); |