文章目录
第一步第二步第三步其他第一步
下载Karabiner软件并安装,在Simple modifications标签页中设置如下,且Mac系统设置中键盘修饰键设置如下。
第二步
代码转自/blog//08/06/how-to-modify-keys/
在目录/Users/name/.config/karabiner/assets/complex_modifications中,创建一个文件custom-casplock.json,内容如下:
{"title": "Change caps_lock to Esc and Control","rules": [{"description": "Post Esc if Caps is tapped, Control if held.","manipulators": [{"type": "basic","from": {"key_code": "left_control","modifiers": {"optional": ["any"]}},"to": [{"key_code": "left_control","lazy": true}],"to_if_alone": [{"key_code": "escape"}]}]}]}
第三步
打开Karabiner软件,在Complex modifications中点击 Add rule,加载custom-capslock.json配置文件后,会看到一条规则“Post Esc if Casp is tapped, Control if held.”,点击后面的Enable按钮。
这时候单独按Caps Lock,实际上就相当于在按Esc;组合Caps Lock和其他键,就相当于是在按Ctrl。
其他
实现单独按command为切换中/英文输入法;组合command和其他键,就相当于是在按command。
同样在目录/Users/name/.config/karabiner/assets/complex_modifications下创建一个文件custom-command.json
内容如下:
{"title": "Change left_command to fn","rules": [{"description": "Post fn if command is tapped, command is held.","manipulators": [{"type": "basic","from": {"key_code": "left_command","modifiers": {"optional": ["any"]}},"to": [{"key_code": "left_command","lazy": true}],"to_if_alone": [{"key_code": "fn"}]}]}]}
文章下载