linux键盘映射修改

linux 键盘映射修改

1. xmodmap
xmodmap -pke | grep -i tab 查看相应按键的键码值(keycode)
xmodmap -pke | grep -i 1 查看全部的键码值
vim ~/.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

vim ~/.bashrc
if [ -f ~/.Xmodmap]; then
/usr/bin/xmodmap ~/.Xmodmap
fi

sudo xmodmap ~/.Xmodmaprc

2. keyboard
sudo vi /etc/default/keyboard
XKBOPTIONS=“ctrl:nocaps” 将 Caps Lock键当作额外的Ctrl键
或者
XKBOPTIONS=“ctrl:swapcaps” .将Ctrl和CapsLock键替换
reboot或者run

sudo dpkg-reconfigure keyboard-configuration

改键有风险,操作需谨慎!

你可能感兴趣的:(学习日志)