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/gui_xim.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui_xim.c') diff --git a/src/gui_xim.c b/src/gui_xim.c index c9b1c6cb4d..c124e8b71e 100644 --- a/src/gui_xim.c +++ b/src/gui_xim.c @@ -1063,6 +1063,9 @@ xim_reset(void) int xim_queue_key_press_event(GdkEventKey *event, int down) { +#ifdef FEAT_GUI_GTK + if (event->state & GDK_SUPER_MASK) return FALSE; +#endif if (down) { // Workaround GTK2 XIM 'feature' that always converts keypad keys to -- cgit v1.2.3