]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable hyper key when super and hyper conflict
authorYuuki Harano <masm+github@masm11.me>
Sat, 29 May 2021 14:56:04 +0000 (23:56 +0900)
committerYuuki Harano <masm+github@masm11.me>
Sat, 29 May 2021 14:56:04 +0000 (23:56 +0900)
* src/pgtkterm.c (x_find_modifier_meanings): If super_mod_mask and
hyper_mod_mask are equal, then disable hyper.

src/pgtkterm.c

index f79329f7ddf4e1f9d946fc2b729c4f27fe742409..e4bf7ba6bd40756cd9431736f41e76a27a00b554 100644 (file)
@@ -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