summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-20 14:43:23 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-20 14:43:23 +0200
commitef6746f637adbdb6860b4fa0266c43c49fa498bc (patch)
treebc6c972c44330f8abab831c728f535326d35aaa8 /src/gui_gtk_x11.c
parent280b0dc815a31b99dafc384baa415072e5f2bec1 (diff)
patch 8.2.1019: mapping <M-S-a> does not work in the GUIv8.2.1019
Problem: Mapping <M-S-a> does not work in the GUI. Solution: Move the logic to remove the shift modifier to may_remove_shift_modifier() and also use it in the GUI.
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index a5af3fa21c..b2770ca47f 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -1211,15 +1211,16 @@ key_press_event(GtkWidget *widget UNUSED,
if (len == 0) // Unrecognized key
return TRUE;
- // Handle modifiers.
- modifiers = modifiers_gdk2vim(state);
-
// For some keys a shift modifier is translated into another key code.
if (len == -3)
key = TO_SPECIAL(string[1], string[2]);
else
key = string[0];
+ // Handle modifiers.
+ modifiers = modifiers_gdk2vim(state);
+
+ // Recognize special keys.
key = simplify_key(key, &modifiers);
if (key == CSI)
key = K_CSI;
@@ -1235,6 +1236,10 @@ key_press_event(GtkWidget *widget UNUSED,
// <C-H> and <C-h> mean the same thing, always use "H"
if ((modifiers & MOD_MASK_CTRL) && ASCII_ISALPHA(key))
key = TOUPPER_ASC(key);
+
+ // May remove the shift modifier if it's included in the key.
+ modifiers = may_remove_shift_modifier(modifiers, key);
+
string[0] = key;
len = 1;
}