To: vim_dev@googlegroups.com Subject: Patch 9.0.0033 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///