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