0%

Karabiner Demo Tutorial

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra or later

Karabiner 是我的 macOS 装机必备之一了,相比Better Touch Tool 之流,稳定性战胜一切。他可以解决macOS 上关于键盘的一切。

首先找到Karabiner的配置文件夹

方法一:从软件进入,在Misc标签页下点击 Open config folder

lGCVR4.png

方法二:直接通过访达进入目录

在访达菜单栏的前往中选择前往文件夹,或者直接快捷键Command + Shift + G,弹出的窗口中输入路径~/.config/karabiner,回车


然后使用文本编辑器创建一个json文件用来存放映射规则,比如叫window_control.json,存放在桌面或任意地方,文件中的内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"title": "Window Control",
"rules": [
{
"description": "Change Insert to Window Switch (Different Apps)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "insert",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"left_command"
]
}
]
}
]
},
{
"description": "Change Del to Window Switch (Same Apps)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "delete_forward",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": [
"left_command"
]
}
]
}
]
}
]
}

将文件拖入刚才的配置文件夹中的子文件夹assets/complex_modifications(如果咩有的话,就手动创建一下),如图

vXJVzH.png


下一步就是去软件中让这条新增的规则生效,打开Complex modifications标签

image-20210823120622061

添加完规则,大功告成