xmodmap:将 Alt_R 附加到 Mod3 组

xmodmap:将 Alt_R 附加到 Mod3 组

我想将特定的 i3 操作绑定到Alt_R+space而不影响Alt_L+ space。两个 Alt 键都附加到Mod1修饰符组:

$ xmodmap -pm | grep mod1
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)

所以我试图将Alt_R其删除Mod1并附加到Mod3(当前为空)。

但我在尝试运行删除时遇到此错误:

$ xmodmap -e 'remove Mod1 = Alt_R'
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  118 (X_SetModifierMapping)
  Value in failed request:  0x17
  Serial number of failed request:  11
  Current serial number in output stream:  11

我已经尝试过mod1Mod1得到相同的结果。我什至尝试过clear

$ xmodmap -e 'clear Mod1'
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  118 (X_SetModifierMapping)
  Value in failed request:  0x17
  Serial number of failed request:  8
  Current serial number in output stream:  8

我究竟做错了什么?

答案1

我正在尝试几乎相同的事情(绑定 hyper 以与 i3 一起使用)并遇到相同的错误。在设置修饰符之前清除它们对我来说是这样。

我仍在研究它,但目前我的 xmodmap 看起来像这样:

keycode   8 =
keycode   9 = Escape NoSymbol Escape
[...]
keycode 254 = XF86WWAN NoSymbol XF86WWAN
keycode 255 = XF86RFKill NoSymbol XF86RFKill

clear shift
clear lock
clear control
clear mod1
clear mod2
clear mod3
clear mod4
clear mod5

add shift =      Shift_L  Shift_R
add lock  =      Caps_Lock
add control =    Control_L  Control_R
add mod1    =    Alt_L Meta_L
add mod2    =    Num_Lock
add mod3    =    Hyper_L Hyper_R
add mod4    =    Super_L Super_R
add mod5    =    ISO_Level3_Shift Mode_switch

相关内容