彻底拯救你的 Mac 外接键盘体验:Karabiner-Elements 高效改键指南

⌨️使用的键盘

Mac mini 外接的是用了很久的 cherry 机械键盘,布局如下:

cherry-keyborad.png

🛒点击立即购买同款

主要看左下角的三个键分别是:

  • Control
  • Win
  • Alt

在 Mac 系统下,它们的分别对应:

  • Control → Control
  • Win → Command
  • Alt → Option

⚙️快捷键调整方案

看下调整了哪些快捷键,列表如下:

功能 Mac 原生快捷键 Windows 快捷键 调整后方案
复制 Command + C Control + C 将Control和Command键对换,仍旧保持Command + C
粘贴 Command + V Control + V 同上,对换保持Command + V
切换中英文输入法 Control + Space(空格) Shift Shift
切换应用 Control + Tab Alt + Tab Option(Alt) + Tab
Home(将光标移到当前行首) Command + ⬅ Home Home
End(将光标移到当前行尾) Command + ➡️ End End

📌后续如果有新增的再补充。

⛏️安装 Karabiner-Elements 工具

由于系统本身不支持这些快捷键调整,因此需要借助第三方工具来完成。

下载并安装可参考官方文档:

Installation

安装完后会有2个应用,分别是 Karabiner-Elements 和 Karabiner-EventViewer。

  • 第1个是我们主要使用的改键工具。
  • 第2个则是键鼠监听工具,可以检查我们配置是否正确,按键会显示出对应的是什么键。

🛠️详细配置

1️⃣交换 Control 与 Command 键

  1. 打开 Karabiner-ElementsSimple Modifications
  2. 选择当前键盘,添加以下两条规则:
    • 将 左边 Command (⌘) → 左边 Control (⌃)
    • 将 左边 Control (⌃) → 左边 Command (⌘)

如下图所示:

image.png

  1. 开启配置,打开 Karabiner-EventViewer 检查修改是否正确,分别按下 ControlWin键,看下打印的是否为:CommandControl

2️⃣设置 Shift 切换中英文输入法

这个配置稍微复杂点。

  1. 打开Karabiner-Elements,进入 Complex Modifications
  2. 点击 Add your own rule,如下图:

image.png

  1. 粘贴以下配置内容,然后点 Save 保存即可:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"description": "Change R_Shift to control + space to switch EN/ZH",
"manipulators": [
{
"from": {
"key_code": "left_shift",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "left_shift",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "spacebar",
"modifiers": ["left_control"]
}
],
"type": "basic"
}
]
}

3️⃣设置 Option(Alt)+Tab 切换应用

同上

  1. 打开Karabiner-Elements,进入 Complex Modifications
  2. 点击 Add your own rule。
  3. 粘贴以下配置内容,然后点 Save 保存即可:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"description": "将 Command+Tab 替换为 Option+Tab切换应用",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": { "mandatory": ["option"] }
},
"to": [
{
"key_code": "tab",
"modifiers": ["command"]
}
],
"type": "basic"
}
]
}

4️⃣设置 Home (将光标移到当前行首)

  1. 打开Karabiner-Elements,进入 Complex Modifications
  2. 点击 Add your own rule。
  3. 粘贴以下配置内容,然后点 Save 保存即可:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"description": "Map Home key to command+left arrow",
"manipulators": [
{
"from": { "key_code": "home" },
"to": [
{
"key_code": "left_arrow",
"modifiers": ["command"]
}
],
"type": "basic"
}
]
}

5️⃣设置 End (将光标移到当前行尾)

  1. 打开Karabiner-Elements,进入 Complex Modifications
  2. 点击 Add your own rule。
  3. 粘贴以下配置内容,然后点 Save 保存即可:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"description": "Map End key to command+right arrow",
"manipulators": [
{
"from": { "key_code": "end" },
"to": [
{
"key_code": "right_arrow",
"modifiers": ["command"]
}
],
"type": "basic"
}
]
}