Mercurial > vim
comparison src/misc2.c @ 20935:d64520bfafa0 v8.2.1019
patch 8.2.1019: mapping <M-S-a> does not work in the GUI
Commit: https://github.com/vim/vim/commit/ef6746f637adbdb6860b4fa0266c43c49fa498bc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 20 14:43:23 2020 +0200
patch 8.2.1019: mapping <M-S-a> does not work in the GUI
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Jun 2020 14:45:03 +0200 |
parents | 9328feafbbf5 |
children | 1c4d4aa22b37 |
comparison
equal
deleted
inserted
replaced
20934:f2f7fd76430e | 20935:d64520bfafa0 |
---|---|
2906 return key; | 2906 return key; |
2907 } | 2907 } |
2908 } | 2908 } |
2909 } | 2909 } |
2910 return 0; | 2910 return 0; |
2911 } | |
2912 | |
2913 | |
2914 /* | |
2915 * Some keys already have Shift included, pass them as normal keys. | |
2916 * Not when Ctrl is also used, because <C-H> and <C-S-H> are different. | |
2917 * Also for <A-S-a> and <M-S-a>. | |
2918 */ | |
2919 int | |
2920 may_remove_shift_modifier(int modifiers, int key) | |
2921 { | |
2922 if ((modifiers == MOD_MASK_SHIFT | |
2923 || modifiers == (MOD_MASK_SHIFT | MOD_MASK_ALT) | |
2924 || modifiers == (MOD_MASK_SHIFT | MOD_MASK_META)) | |
2925 && ((key >= '@' && key <= 'Z') | |
2926 || key == '^' || key == '_' | |
2927 || (key >= '{' && key <= '~'))) | |
2928 return modifiers & ~MOD_MASK_SHIFT; | |
2929 return modifiers; | |
2911 } | 2930 } |
2912 | 2931 |
2913 /* | 2932 /* |
2914 * Try to include modifiers in the key. | 2933 * Try to include modifiers in the key. |
2915 * Changes "Shift-a" to 'A', "Alt-A" to 0xc0, etc. | 2934 * Changes "Shift-a" to 'A', "Alt-A" to 0xc0, etc. |