Linux 下是编辑 ~/.Xmodmap 文件
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
然后使之生效:xmodmap ~/.Xmodmap 。每次键盘接口重插上时可能得执行下该命令,而每次开机会自动运行该命令。
Windows 下是修改注册表
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,3a,00,01,00,01,00,3a,00,00,00,00,00
上面三行保存为 CapsLock2Esc.reg ,点击执行即可