if-else chain -> switch-case
This commit is contained in:
parent
5cbfb8113d
commit
a4de8fdbc1
19
termite.cc
19
termite.cc
|
@ -604,15 +604,16 @@ 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) {
|
||||||
synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Down);
|
case GDK_KEY_Tab:
|
||||||
return TRUE;
|
synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Down);
|
||||||
} else if (event->keyval == GDK_KEY_ISO_Left_Tab) {
|
return TRUE;
|
||||||
synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Up);
|
case GDK_KEY_ISO_Left_Tab:
|
||||||
return TRUE;
|
synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Up);
|
||||||
} else if (event->keyval == GDK_KEY_Down) {
|
return TRUE;
|
||||||
// this stops the down key from leaving the GtkEntry...
|
case GDK_KEY_Down:
|
||||||
event->hardware_keycode = 0;
|
// this stops the down key from leaving the GtkEntry...
|
||||||
|
event->hardware_keycode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
Loading…
Reference in New Issue