Keyboard-Layout
使用 xcape 將 Caps Lock 映射到 Ctrl 和 Esc 後將 Esc 重新映射到 Caps Lock
我目前已經通過這些命令
Caps Lock
映射到Ctrl
何時按住和Esc
點擊(對於vim).xinitrc
setxkbmap -option 'caps:ctrl_modifier' xcape -e 'Caps_Lock=Escape'
這可行,但讓我沒有
Caps Lock
,所以我想重新映射Esc
到Caps Lock
. 我試過設置它,xmodmap -e 'keycode 9 = Caps_Lock'
但這也覆蓋了Caps Lock
鍵上的映射。有沒有辦法實現這些映射?Caps Lock -> Ctrl and Esc Esc -> Caps Lock
您可以使用
setxkbmap
或xmodmap
交換 Caps Lock 和 Escape。xmodmap
你可以擁有:! Remove Caps_Lock modifier from real Caps Lock key clear Lock ! Set real Caps Lock key to present as (left) control keycode 66 = Control_L ! Set real Escape key to present as Caps Lock keycode 9 = Caps_Lock ! Make a fake key to hold the Escape keysym, so xcape can use it keycode 255 = Escape ! Make Caps_Lock and Control_L work as one would expect add Lock = Caps_Lock add Control = Control_L
(以開頭的行
!
是註釋。)將其放入
~/.xmodmaprc
並執行xmodmap ~/.xmodmaprc
,然後執行xcape -e '#66=Escape'
以將 Escape 功能添加到真正的 Caps Lock 鍵。