Fix shortcut evaluation

This commit is contained in:
Moritz Lipp 2010-06-21 16:19:06 +02:00
parent 3604922a95
commit 403c63c510

View file

@ -3878,15 +3878,17 @@ cb_view_kb_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data)
ShortcutList* sc = Zathura.Bindings.sclist; ShortcutList* sc = Zathura.Bindings.sclist;
while(sc) while(sc)
{ {
if( event->keyval == sc->element.key && if(
((CLEAN(event->state) == sc->element.mask) || event->keyval == sc->element.key
((sc->element.mask == 0) && (sc->element.key >= 0x21 && sc->element.key <= 0x7E))) && && (CLEAN(event->state) == sc->element.mask || (sc->element.key >= 0x21
(Zathura.Global.mode & sc->element.mode || sc->element.mode == ALL) && && sc->element.key <= 0x7E && event->state == GDK_SHIFT_MASK))
sc->element.function && (Zathura.Global.mode & sc->element.mode || sc->element.mode == ALL)
&& sc->element.function
) )
{ {
if(!(Zathura.Global.buffer && strlen(Zathura.Global.buffer->str)) ^ if(!(Zathura.Global.buffer && strlen(Zathura.Global.buffer->str)) || (sc->element.mask == GDK_CONTROL_MASK) ||
((sc->element.mask == GDK_CONTROL_MASK) || (sc->element.mask == GDK_MOD1_MASK))) (sc->element.key <= 0x21 || sc->element.key >= 0x7E)
)
{ {
sc->element.function(&(sc->element.argument)); sc->element.function(&(sc->element.argument));
return TRUE; return TRUE;