如何使用xmodmap交换ctrl和大写锁定


10

或者任何其他工具,但我更喜欢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"

但似乎都没有完全奏效。这是按下大写锁定的事件日志:

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。

Answers:


8

来自Remap Caps Lock

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

嗯,这是我在帖子中的第一次尝试。
Maruti

Oups,错过了。那为什么这次呢?
harrymc 2011年

我不确定。我想在干涉密码后我忘了重置密钥图。
Maruti

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.