restrict modifiers used on key-bindings. Should fix T1695

This commit is contained in:
Boris Faure 2014-10-02 21:42:03 +02:00
parent 8778e1d987
commit bf288c8031
2 changed files with 20 additions and 7 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}