discomfitor pushed a commit to branch efl-1.20.

http://git.enlightenment.org/core/efl.git/commit/?id=3fede879dfeeac62b7fffec9d8cbed4115d8d1ad

commit 3fede879dfeeac62b7fffec9d8cbed4115d8d1ad
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Aug 18 15:24:51 2017 -0400

    wayland: fix num/caps lock handling in events
    
    locks are not the same as modifiers, and the corresponding event flag must
    be set based on whichever value(s) are set instead of yolo mixing and 
matching
    
    @fix
    
    ref T5737
---
 src/lib/ecore_wl2/ecore_wl2_input.c | 13 +++++++++++--
 src/lib/elput/elput_evdev.c         |  9 +++++++++
 src/lib/elput/elput_private.h       |  1 +
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c 
b/src/lib/ecore_wl2/ecore_wl2_input.c
index da6fe7cd59..d20849eda2 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1152,14 +1152,23 @@ _keyboard_cb_modifiers(void *data, struct wl_keyboard 
*keyboard EINA_UNUSED, uns
      input->keyboard.modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
    if (mask & input->xkb.win_mask)
      input->keyboard.modifiers |= ECORE_EVENT_MODIFIER_WIN;
+   if (mask & input->xkb.altgr_mask)
+     input->keyboard.modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
+   if (mask & input->xkb.scroll_mask)
+     input->keyboard.modifiers |= ECORE_EVENT_MODIFIER_SCROLL;
+   if (mask & input->xkb.num_mask)
+     input->keyboard.modifiers |= ECORE_EVENT_MODIFIER_NUM;
+   if (mask & input->xkb.caps_mask)
+     input->keyboard.modifiers |= ECORE_EVENT_MODIFIER_CAPS;
+
+
+   mask = xkb_state_serialize_mods(input->xkb.state, XKB_STATE_MODS_LOCKED);
    if (mask & input->xkb.scroll_mask)
      input->keyboard.modifiers |= ECORE_EVENT_LOCK_SCROLL;
    if (mask & input->xkb.num_mask)
      input->keyboard.modifiers |= ECORE_EVENT_LOCK_NUM;
    if (mask & input->xkb.caps_mask)
      input->keyboard.modifiers |= ECORE_EVENT_LOCK_CAPS;
-   if (mask & input->xkb.altgr_mask)
-     input->keyboard.modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
 }
 
 static void
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 1199a09798..09d75932f8 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -82,6 +82,13 @@ _keyboard_modifiers_update(Elput_Keyboard *kbd, Elput_Seat 
*seat)
      seat->modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
    if (mask & kbd->info->mods.caps)
      seat->modifiers |= ECORE_EVENT_MODIFIER_CAPS;
+   if (mask & kbd->info->mods.num)
+     seat->modifiers |= ECORE_EVENT_MODIFIER_NUM;
+
+   if (kbd->mods.locked & kbd->info->mods.caps)
+     seat->modifiers |= ECORE_EVENT_LOCK_CAPS;
+   if (kbd->mods.locked & kbd->info->mods.num)
+     seat->modifiers |= ECORE_EVENT_LOCK_NUM;
 
    if (xkb_state_led_index_is_active(kbd->state, kbd->info->leds.num))
      leds |= ELPUT_LED_NUM;
@@ -121,6 +128,8 @@ _keyboard_info_create(struct xkb_keymap *keymap)
      1 << xkb_keymap_mod_get_index(info->keymap.map, XKB_MOD_NAME_SHIFT);
    info->mods.caps =
      1 << xkb_keymap_mod_get_index(info->keymap.map, XKB_MOD_NAME_CAPS);
+   info->mods.num =
+     1 << xkb_keymap_mod_get_index(info->keymap.map, "Mod2");
    info->mods.ctrl =
      1 << xkb_keymap_mod_get_index(info->keymap.map, XKB_MOD_NAME_CTRL);
    info->mods.alt =
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index f5bc425182..a4ea37b8a1 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -106,6 +106,7 @@ typedef struct _Elput_Keyboard_Info
      {
         xkb_mod_index_t shift;
         xkb_mod_index_t caps;
+        xkb_mod_index_t num;
         xkb_mod_index_t ctrl;
         xkb_mod_index_t alt;
         xkb_mod_index_t altgr;

-- 


Reply via email to