Patch 9.0.0033

7 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 4, 2022, 5:48:32 AM7/4/22
to vim...@googlegroups.com

Patch 9.0.0033
Problem: On a Belgian keyboard CTRL-[ does not work.
Solution: Handle GDK_KEY_dead_circumflex. (Anton Sharonov, closes #10658)
Files: src/gui_gtk_x11.c


*** ../vim-9.0.0032/src/gui_gtk_x11.c 2022-04-28 14:06:56.000000000 +0100
--- src/gui_gtk_x11.c 2022-07-04 10:44:25.309382191 +0100
***************
*** 1160,1165 ****
--- 1160,1166 ----
int key;
guint state;
char_u *s, *d;
+ int ctrl_prefix_added = 0;

gui.event_time = event->time;
key_sym = event->keyval;
***************
*** 1245,1250 ****
--- 1246,1265 ----
}
}

+ // 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,1293 ****
--- 1303,1310 ----
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,1307 ****
--- 1319,1333 ----
}
}

+ // 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
*** ../vim-9.0.0032/src/version.c 2022-07-03 14:20:44.788010407 +0100
--- src/version.c 2022-07-04 10:46:04.689233304 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 33,
/**/

--
Light travels faster than sound. This is why some people
appear bright until you hear them speak

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Tony Mechelynck

unread,
Jul 4, 2022, 9:50:44 AM7/4/22
to vim_dev
On Mon, Jul 4, 2022 at 11:48 AM Bram Moolenaar <Br...@moolenaar.net> wrote:
>
>
> Patch 9.0.0033
> Problem: On a Belgian keyboard CTRL-[ does not work.
> Solution: Handle GDK_KEY_dead_circumflex. (Anton Sharonov, closes #10658)
> Files: src/gui_gtk_x11.c

FYI: In gvim 9.0.32 (Big, GTK3) i.e. without this patch, with Belgian
keyboard on openSUSE Tumbleweed, in Insert mode, Ctrl-V followed by
Ctrl+AltGr+dead-circumflex inserts an Esc character (displayed as ^[
in blue) into the buffer.

This is, however, a complex keychord. It is also possible to assign
<Esc> as the {rhs} of a mapping.

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages