aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2022-06-21 02:06:11 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2022-06-21 02:06:11 +0200
commitf15bc53a011bcfbcb6848c19cae2d5ae4ff1fc64 (patch)
tree343002f9b99fda6296630825c680ad37c189cef5 /src/interface-gtk
parent8031da622a7c3c86c1d212858b2e5b239e98322c (diff)
downloadsciteco-f15bc53a011bcfbcb6848c19cae2d5ae4ff1fc64.tar.gz
Gtk+: fixed interpretation of Alt-Gr-keypresses
* this is a regression in Gtk+ 3 * nowadays, Alt-Gr-keycombos are sometimes reported as Ctrl+Alt which resulted in control characters to be inserted
Diffstat (limited to 'src/interface-gtk')
-rw-r--r--src/interface-gtk/interface.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 207d01c..9b87abb 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -718,6 +718,7 @@ teco_interface_popup_clear(void)
* @todo It would be great to have platform-specific optimizations,
* so we can detect interruptions without having to drive the Glib
* event loop (e.g. using libX11 or Win32 APIs).
+ * There already is a keyboard hook for Win32 in interface-curses.
* On the downside, such solutions will probably freeze the window
* while SciTECO is busy.
*/
@@ -883,7 +884,11 @@ teco_interface_handle_key_press(guint keyval, guint state, GError **error)
g_unichar_to_utf8(u, &key);
if (key > 0x7F)
break;
- if (state & GDK_CONTROL_MASK)
+ /*
+ * NOTE: Alt-Gr key-combinations are sometimes reported as
+ * Ctrl+Alt, so we filter those out.
+ */
+ if ((state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)) == GDK_CONTROL_MASK)
key = TECO_CTL_KEY(g_ascii_toupper(key));
if (!teco_cmdline_keypress_c(key, error))