if-else chain -> switch-case

This commit is contained in:
Daniel Micay 2012-09-28 09:52:53 -04:00
parent 5cbfb8113d
commit a4de8fdbc1
1 changed files with 10 additions and 9 deletions

View File

@ -604,13 +604,14 @@ gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, keybind_info *i
ret = TRUE; ret = TRUE;
} }
if (event->keyval == GDK_KEY_Tab) { switch (event->keyval) {
case GDK_KEY_Tab:
synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Down); synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Down);
return TRUE; return TRUE;
} else if (event->keyval == GDK_KEY_ISO_Left_Tab) { case GDK_KEY_ISO_Left_Tab:
synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Up); synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Up);
return TRUE; return TRUE;
} else if (event->keyval == GDK_KEY_Down) { case GDK_KEY_Down:
// this stops the down key from leaving the GtkEntry... // this stops the down key from leaving the GtkEntry...
event->hardware_keycode = 0; event->hardware_keycode = 0;
} }