summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Sharonov <anton.sharonov@gmail.com>2022-07-04 10:47:31 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-04 10:47:31 +0100
commit4dd9252d6f0e93c9118c808bd47f407d581947a8 (patch)
tree8ace22652755f6eed142e3093fa83642f761e77f
parent7fe956d17650b231f173868531bc7466010687f0 (diff)
patch 9.0.0033: on a Belgian keyboard CTRL-[ does not workv9.0.0033
Problem: On a Belgian keyboard CTRL-[ does not work. Solution: Handle GDK_KEY_dead_circumflex. (Anton Sharonov, closes #10658)
-rw-r--r--src/gui_gtk_x11.c26
-rw-r--r--src/version.c2
2 files changed, 28 insertions, 0 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 0cd6613032..fd582dd799 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -1160,6 +1160,7 @@ key_press_event(GtkWidget *widget UNUSED,
int key;
guint state;
char_u *s, *d;
+ int ctrl_prefix_added = 0;
gui.event_time = event->time;
key_sym = event->keyval;
@@ -1245,6 +1246,20 @@ key_press_event(GtkWidget *widget UNUSED,
}
}
+ // Belgian Ctrl+[ workaround
+ if (len == 0 && key_sym == GDK_KEY_dead_circumflex)
+ {
+ string[0] = CSI;
+ string[1] = KS_MODIFIER;
+ string[2] = MOD_MASK_CTRL;
+ string[3] = '[';
+ len = 4;
+ add_to_input_buf(string, len);
+ // workaround has to return here, otherwise our fake string[] entries
+ // are confusing code downstream
+ return TRUE;
+ }
+
if (len == 0) // Unrecognized key
return TRUE;
@@ -1288,6 +1303,8 @@ key_press_event(GtkWidget *widget UNUSED,
string2[1] = KS_MODIFIER;
string2[2] = modifiers;
add_to_input_buf(string2, 3);
+ if (modifiers == 0x4)
+ ctrl_prefix_added = 1;
}
// Check if the key interrupts.
@@ -1302,6 +1319,15 @@ key_press_event(GtkWidget *widget UNUSED,
}
}
+ // workaround for German keyboard, where instead of '[' char we have code
+ // sequence of bytes 195, 188 (UTF-8 for "u-umlaut")
+ if (ctrl_prefix_added && len == 2
+ && ((int)string[0]) == 195
+ && ((int)string[1]) == 188)
+ {
+ string[0] = 91; // ASCII('[')
+ len = 1;
+ }
add_to_input_buf(string, len);
// blank out the pointer if necessary
diff --git a/src/version.c b/src/version.c
index 1232f4e02f..419e25f6d3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 33,
+/**/
32,
/**/
31,