From bf288c8031718d4c5ee64ea0135a4aaf1697ad1c Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Thu, 2 Oct 2014 21:42:03 +0200 Subject: [PATCH] restrict modifiers used on key-bindings. Should fix T1695 --- src/bin/keyin.c | 17 +++++++++++------ src/bin/options_keys.c | 10 +++++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/bin/keyin.c b/src/bin/keyin.c index e48cfe83..85b06ba3 100644 --- a/src/bin/keyin.c +++ b/src/bin/keyin.c @@ -218,15 +218,20 @@ Eina_Bool keyin_handle(Keys_Handler *khdl, Termpty *ty, const Evas_Event_Key_Down *ev, Eina_Bool ctrl, Eina_Bool alt, Eina_Bool shift, Eina_Bool win) { - Key_Binding *kb; - kb = key_binding_lookup(ev->keyname, ctrl, alt, shift, win); - if (kb) + if (!evas_key_modifier_is_set(ev->modifiers, "Meta") && + !evas_key_modifier_is_set(ev->modifiers, "Hyper") && + !evas_key_modifier_is_set(ev->modifiers, "ISO_Level3_Shift")) { - if (kb->cb(ty->obj)) + Key_Binding *kb; + kb = key_binding_lookup(ev->keyname, ctrl, alt, shift, win); + if (kb) { - keyin_compose_seq_reset(khdl); - return EINA_TRUE; + if (kb->cb(ty->obj)) + { + keyin_compose_seq_reset(khdl); + return EINA_TRUE; + } } } diff --git a/src/bin/options_keys.c b/src/bin/options_keys.c index 05a07e29..65bb79a1 100644 --- a/src/bin/options_keys.c +++ b/src/bin/options_keys.c @@ -88,10 +88,18 @@ _cb_key_up(void *data, Evas *e EINA_UNUSED, _hover_del(obj); + if (evas_key_modifier_is_set(ev->modifiers, "Meta") || + evas_key_modifier_is_set(ev->modifiers, "Hyper") || + evas_key_modifier_is_set(ev->modifiers, "ISO_Level3_Shift")) + { + ERR("Modifiers Meta/Hyper/ISO_Level3_Shift are not supported in keybindings"); + return; + } + action = evas_object_data_get(bx, "action"); if (!action) { - ERR("can't find any action to associate with"); + ERR("can't find any action to associate with."); return; }