From 7085fecf53d9506b1f626e3cab1dd90e33aa9ed0 Mon Sep 17 00:00:00 2001 From: Yuuki Harano Date: Sat, 29 May 2021 23:56:04 +0900 Subject: [PATCH] Disable hyper key when super and hyper conflict * src/pgtkterm.c (x_find_modifier_meanings): If super_mod_mask and hyper_mod_mask are equal, then disable hyper. --- src/pgtkterm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pgtkterm.c b/src/pgtkterm.c index f79329f7ddf..e4bf7ba6bd4 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -5462,6 +5462,16 @@ x_find_modifier_meanings (struct pgtk_display_info *dpyinfo) { dpyinfo->hyper_mod_mask = GDK_MOD3_MASK; } + + /* If xmodmap says: + * $ xmodmap | grep mod4 + * mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) + * then, when mod4 is pressed, both of super and hyper are recognized ON. + * Maybe many people have such configuration, and they don't like such behavior, + * so I disable hyper if such configuration is detected. + */ + if (dpyinfo->hyper_mod_mask == dpyinfo->super_mod_mask) + dpyinfo->hyper_mod_mask = 0; } static void -- 2.39.5