或者任何其他工具,但我更喜欢 xmodmap。我尝试过这个:
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
我也尝试过这个:
xmodmap -e "keycode 66 = Control_L"
但似乎都没有完全发挥作用。以下是按下 Caps Lock 的事件日志:
KeyPress event, serial 28, synthetic NO, window 0x1a00001,
root 0x12d, subw 0x0, time 914826, (679,342), root:(680,362),
state 0x12, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
XKeysymToKeycode returns keycode: 37 // 37 is the control key code
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
我正在运行带有超棒窗口管理器的 Ubuntu 10.10。
答案1
man xmodmap 显示了如何交换左控制键和 CapsLock 键:
! ! Swap Caps_Lock and Control_L ! remove Lock = Caps_Lock remove Control = Control_L keysym Control_L = Caps_Lock keysym Caps_Lock = Control_L add Lock = Caps_Lock add Control = Control_L
答案2
这可能对你有用。
/usr/bin/setxkbmap -option "ctrl:swapcaps"