之前我一直用Windows或Linux,后来使用Mac OS,感觉还是有很多不习惯的地方。特别是一些常用的快捷键,比如复制、粘贴等快捷键,在Windows下是使用ctrl键,而在Mac OS下是使用command键。而且我还使用Windows虚拟机,经常需要来回切换快捷键,使用很不习惯。最近网上搜索到一个软件可以修改快捷键映射,完美解决这个问题。现记录一下:
1.下载并安装一个软件 Karabiner-Elements,官方地址: https://pqrs.org/osx/karabiner/。
2.软件打开的界面如下:
3.点击 “Complex modifications”,出现的界面如下:
4.点击 “Add rule”,出现界面如下:
5.点击 “import more rules from the internet”,会打开一个页面
6.点击页面的“import” 导入规则,导入成功后,可以看到新增的如下两条规则:
7.点击第一条规则的 “Enable” ,使用这条规则。
这条规则会立即将键盘上左边的 ctrl + 字母键 映射为 command + 字母键。大功告成!
如果要去掉多余的映射关系,则直接修改
~/.config/karabiner/assets/complex_modifications/1575427520.json
这个文件,把不需要的映射关系去掉,只保留常用的即可,如下所示:
{ "title": "Change control + letter keys to command + letter keys", "rules": [ { "description": "Change left_control + letter to left_command + letter", "manipulators": [ { "type": "basic", "from": { "key_code": "a", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "a", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "b", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "b", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "c", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "c", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "f", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "f", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "h", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "h", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "n", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "n", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "o", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "o", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "s", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "s", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "v", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "v", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "x", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "x", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "y", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "y", "modifiers": [ "left_command" ] } ] }, { "type": "basic", "from": { "key_code": "z", "modifiers": { "mandatory": ["left_control"], "optional": ["any"] } }, "to": [ { "key_code": "z", "modifiers": [ "left_command" ] } ] } ] } ] }
如果要取消键的映射,则删除这条规则即可。
这个软件的功能非常强大,可以定制键盘所有的按键功能,根据需要可以参考官方文档深入研究。

LuckTang's Blog 站长语录
LuckTang's Blog,欢迎各位来访!这是我的QQ,扫一扫,加好友。大家一起交流博客建站技术,分享前沿资讯!
评论