Xmodmap 设置新 mod 键时出现错误

Xmodmap 设置新 mod 键时出现错误

我尝试使用 cap lock 键作为 mod 键。

我有这个.Xmodmap:

clear lock 
clear mod2
keycode 66 = Hyper_L
add mod2 = Hyper_L

和这个xmodmap -pm

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Hyper_L (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

运行时xmodmap .Xmodmap出现此错误:

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:  13                                                                                                        
  Current serial number in output stream:  13         

您知道如何解决这个问题吗?

操作系统:Ubuntu 17.10

答案1

没有 Caps_Lock 键也没关系?
试试:

clear lock 
keycode 66 = Hyper_L
remove mod4 = Hyper_L
add mod2 = Hyper_L

基于@heymatthew 回答CapsLock 作为应用程序键盘映射的修饰键

相关内容