From 92e90a1e102825aa9149262cacfc991264db05df Mon Sep 17 00:00:00 2001 From: Casey Tucker Date: Thu, 25 Jan 2024 22:44:00 +0100 Subject: patch 9.1.0058: Cannot map Super Keys in GTK UI Problem: Cannot map Super Keys in GTK UI (Casey Tucker) Solution: Enable Super Key mappings in GTK using (Casey Tucker) As a developer who works in both Mac and Linux using the same keyboard, it can be frustrating having to remember different key combinations or having to rely on system utilities to remap keys. This change allows `` `` `` `` etc. to be recognized by the `map` commands, along with the `` shifted variants. ```vimrc if has('gui_gtk') nnoremap u nnoremap vnoremap "+d vnoremap "+y cnoremap + inoremap "+gP nnoremap "+P vnoremap "-d"+P nnoremap :w inoremap :w nnoremap :q nnoremap :qa nnoremap :tabe nnoremap :vs#T nnoremap ggVG vnoremap ggVG inoremap ggVG nnoremap / nnoremap n nnoremap N vnoremap "+x endif ``` closes: #12698 Signed-off-by: Casey Tucker Signed-off-by: Christian Brabandt --- src/keymap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/keymap.h') diff --git a/src/keymap.h b/src/keymap.h index 6fddc7f565..29e2a055ca 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -500,8 +500,8 @@ enum key_extra #define MOD_MASK_2CLICK 0x20 // use MOD_MASK_MULTI_CLICK #define MOD_MASK_3CLICK 0x40 // use MOD_MASK_MULTI_CLICK #define MOD_MASK_4CLICK 0x60 // use MOD_MASK_MULTI_CLICK -#ifdef MACOS_X -# define MOD_MASK_CMD 0x80 +#if defined(MACOS_X) || defined(FEAT_GUI_GTK) +# define MOD_MASK_CMD 0x80 // aka SUPER #endif #define MOD_MASK_MULTI_CLICK (MOD_MASK_2CLICK|MOD_MASK_3CLICK|MOD_MASK_4CLICK) -- cgit v1.2.3