devilhorns pushed a commit to branch master.

commit 3cc3d0878a6dc29d0dcac9c2f5495bc8bdd84b7f
Author: Chris Michael <[email protected]>
Date:   Wed Aug 7 10:42:34 2013 +0100

    Convert upper-case characters to lower-case characters on keydown
    events.
    
    NB: xkbcommon automatically converts the pressed key to Upper if Shift
    is pressed. this is a problem as ecore key down events expect them to
    be lower-case (not converted yet).
    
    NB: Fixes Phab Ticket T232.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wayland/ecore_wl_input.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wayland/ecore_wl_input.c 
b/src/lib/ecore_wayland/ecore_wl_input.c
index 1cde8c0..0ece81b 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -20,6 +20,7 @@
 #include "ecore_wl_private.h"
 #include <sys/mman.h>
 #include <sys/timerfd.h>
+#include <ctype.h>
 
 /* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ... 
  *        What about other OSs ?? */
@@ -656,13 +657,26 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct 
wl_keyboard *keyboard EINA_UN
    memset(key, 0, sizeof(key));
    xkb_keysym_get_name(sym, key, sizeof(key));
 
+   xkb_state_mod_mask_remove_consumed(input->xkb.state, 
+                                      code, input->xkb.shift_mask);
+
    memset(keyname, 0, sizeof(keyname));
    xkb_keysym_get_name(sym, keyname, sizeof(keyname));
+   if (xkb_state_mod_index_is_active(input->xkb.state, 
+                                     xkb_map_mod_get_index(input->xkb.keymap, 
+                                                           "Shift"),
+                                     XKB_STATE_MODS_EFFECTIVE))
+     {
+        if (keyname[0] != '\0')
+          keyname[0] = tolower(keyname[0]);
+     }
+
    if (keyname[0] == '\0')
      snprintf(keyname, sizeof(keyname), "Keycode-%u", code);
 
    memset(compose, 0, sizeof(compose));
-   _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, compose, 
sizeof(compose));
+   _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, 
+                                           compose, sizeof(compose));
 
    e = malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
               ((compose[0] != '\0') ? strlen(compose) : 0) + 3);

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

Reply via email to