0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>

Problem:    GTK GUI: cannot map alt-? with <A-?>. (Ingo Karkat)
Solution:   Adjust the characters for which the shift modifier is removed.
            (closes #7016)  Make Motif and Win32 use the same function as GTK.
This commit is contained in:
Bram Moolenaar
2020-09-27 13:16:46 +02:00
parent bade44e5ca
commit daff0fb738
5 changed files with 22 additions and 6 deletions

View File

@@ -2950,6 +2950,7 @@ find_special_key(
* Some keys already have Shift included, pass them as normal keys.
* Not when Ctrl is also used, because <C-H> and <C-S-H> are different.
* Also for <A-S-a> and <M-S-a>.
* This includes all printable ASCII characters except numbers and a-z.
*/
int
may_remove_shift_modifier(int modifiers, int key)
@@ -2957,8 +2958,9 @@ may_remove_shift_modifier(int modifiers, int key)
if ((modifiers == MOD_MASK_SHIFT
|| modifiers == (MOD_MASK_SHIFT | MOD_MASK_ALT)
|| modifiers == (MOD_MASK_SHIFT | MOD_MASK_META))
&& ((key >= '@' && key <= 'Z')
|| key == '^' || key == '_'
&& ((key >= '!' && key <= '/')
|| (key >= ':' && key <= 'Z')
|| (key >= '[' && key <= '`')
|| (key >= '{' && key <= '~')))
return modifiers & ~MOD_MASK_SHIFT;
return modifiers;