GTK: Handle Shift+Tab properly.

According to
https://mail.gnome.org/archives/gtk-list/1999-August/msg00145.html
pressing Shift+Tab generates a special keyval of ISO_Left_Tab, without
a GDK_SHIFT_MASK applied. We now handle this case so that the midend
receives ('\t' | MOD_SHFT) as intended. This will be used by the
upcoming Untangle keyboard interface.
This commit is contained in:
Franklin Wei
2024-07-21 04:55:01 -04:00
committed by Simon Tatham
parent 3f8ef29078
commit b50a95807a

5
gtk.c
View File

@ -1541,6 +1541,11 @@ static gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
keyval = '\177'; keyval = '\177';
else if ((event->keyval == 'z' || event->keyval == 'Z') && shift && ctrl) else if ((event->keyval == 'z' || event->keyval == 'Z') && shift && ctrl)
keyval = UI_REDO; keyval = UI_REDO;
else if (event->keyval == GDK_KEY_ISO_Left_Tab) {
/* SHIFT+TAB gets special handling. Ref:
* https://mail.gnome.org/archives/gtk-list/1999-August/msg00145.html */
keyval = '\t' | MOD_SHFT;
}
else if (event->string[0] && !event->string[1]) else if (event->string[0] && !event->string[1])
keyval = (unsigned char)event->string[0]; keyval = (unsigned char)event->string[0];
else else