To: vim_dev@googlegroups.com Subject: Patch 8.2.0770 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0770 Problem: Cannot map CTRL-B when using the GUI. Solution: Reset the CTRL modifier when used. (closes #6092) Files: src/gui_gtk_x11.c *** ../vim-8.2.0769/src/gui_gtk_x11.c 2020-05-16 14:01:48.113547782 +0200 --- src/gui_gtk_x11.c 2020-05-16 18:45:02.368174589 +0200 *************** *** 1023,1029 **** * http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html#GdkEventKey */ static int ! keyval_to_string(unsigned int keyval, unsigned int state, char_u *string) { int len; guint32 uc; --- 1023,1029 ---- * http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html#GdkEventKey */ static int ! keyval_to_string(unsigned int keyval, unsigned int *state, char_u *string) { int len; guint32 uc; *************** *** 1031,1038 **** uc = gdk_keyval_to_unicode(keyval); if (uc != 0) { ! // Check for CTRL-foo ! if ((state & GDK_CONTROL_MASK) && uc >= 0x20 && uc < 0x80) { // These mappings look arbitrary at the first glance, but in fact // resemble quite exactly the behaviour of the GTK+ 1.2 GUI on my --- 1031,1038 ---- uc = gdk_keyval_to_unicode(keyval); if (uc != 0) { ! // Check for CTRL-char ! if ((*state & GDK_CONTROL_MASK) && uc >= 0x20 && uc < 0x80) { // These mappings look arbitrary at the first glance, but in fact // resemble quite exactly the behaviour of the GTK+ 1.2 GUI on my *************** *** 1051,1056 **** --- 1051,1060 ---- else string[0] = uc; len = 1; + + if (string[0] != uc) + // The modifier was used, remove it. + *state = *state & ~GDK_CONTROL_MASK; } else { *************** *** 1169,1175 **** else #endif { ! len = keyval_to_string(key_sym, state, string2); // Careful: convert_input() doesn't handle the NUL character. // No need to convert pure ASCII anyway, thus the len > 1 check. --- 1173,1179 ---- else #endif { ! len = keyval_to_string(key_sym, &state, string2); // Careful: convert_input() doesn't handle the NUL character. // No need to convert pure ASCII anyway, thus the len > 1 check. *** ../vim-8.2.0769/src/version.c 2020-05-16 16:08:30.098714978 +0200 --- src/version.c 2020-05-16 18:57:24.141264151 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 770, /**/ -- hundred-and-one symptoms of being an internet addict: 108. While reading a magazine, you look for the Zoom icon for a better look at a photograph. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///