安装 Interception Tools
Archlinux
pacman -S interception-tools
Ubuntu
sudo add-apt-repository ppa:deafmute/interception
sudo apt install interception-tools
安装 caps2esc 插件
该插件将单击 Caps 键映射为 Esc 键,长按 Caps 键映射为 Ctrl 键。
Archlinux
pacman -S interception-caps2esc
Ubuntu
sudo add-apt-repository ppa:deafmute/interception
sudo apt install interception-caps2esc
创建 udevmon 配置文件
vim /etc/udevmon.yaml
- JOB: "intercept -g $DEVNODE | caps2esc | uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]
创建系统服务
vim /etc/systemd/system/udevmon.service
[Unit]
Description=udevmon
[Service]
ExecStart=/usr/bin/nice -n -20 /usr/bin/udevmon -c /etc/udevmon.yaml
[Install]
WantedBy=multi-user.target
systemctl enable udevmon
systemctl start udevmon