discomfitor pushed a commit to branch enlightenment-0.19.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=5b7ad4d342458a1a6c71dcdf88c0d690a8ef19f8

commit 5b7ad4d342458a1a6c71dcdf88c0d690a8ef19f8
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Apr 20 15:31:41 2015 -0400

    swap key -> keyname when attempting to bind lparen/rparen keys
    
    this is impossible to grab on X, so ensure the generated binding is usable
    
    fix T2059
---
 src/modules/conf_bindings/e_int_config_keybindings.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/modules/conf_bindings/e_int_config_keybindings.c 
b/src/modules/conf_bindings/e_int_config_keybindings.c
index f470bee..83830bd 100644
--- a/src/modules/conf_bindings/e_int_config_keybindings.c
+++ b/src/modules/conf_bindings/e_int_config_keybindings.c
@@ -859,6 +859,7 @@ _grab_key_down_cb(void *data,
         const Eina_List *l = NULL;
         unsigned int mod = E_BINDING_MODIFIER_NONE;
         unsigned int n, found = 0;
+        const char *key = ev->key;
 
         if (!e_bindings_key_allowed(ev->key))
           return ECORE_CALLBACK_PASS_ON;
@@ -872,6 +873,10 @@ _grab_key_down_cb(void *data,
         if (ev->modifiers & ECORE_EVENT_MODIFIER_WIN)
           mod |= E_BINDING_MODIFIER_WIN;
 
+        /* swap for un-shifted key; binding '(' or ')' is impossible */
+        if ((ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) &&
+            (eina_streq(ev->key, "parenleft") || eina_streq(ev->key, 
"parenright")))
+          ev->key = ev->keyname;
         if (cfdata->locals.add)
           found = !!e_util_binding_match(cfdata->binding.key, ev, &n, NULL);
         else if (cfdata->locals.cur && cfdata->locals.cur[0])
@@ -988,6 +993,7 @@ _grab_key_down_cb(void *data,
              e_widget_ilist_selected_set(cfdata->gui.o_binding_list, n);
           }
         e_object_del(E_OBJECT(cfdata->locals.eg));
+        ev->key = key;
      }
    return ECORE_CALLBACK_PASS_ON;
 }

-- 


Reply via email to