作为一个码农,带TouchBar的键盘只有虚拟ESC。只好映射一下,下边的`当ESC不错。同时把caps_lock映射成Ctrl。
那么ctrl+`改为`, shift+`改成~
1.安装karabiner。
2.设置karabiner属性里的simple modifications增加caps_lock to left_control
3.增加脚本
vim ~/.config/karabiner/assets/complex_modifications/1541404156.json
{
"title": "Change ctrl+` is `",
"rules": [
{
"description": "Change grave accent and tilde to escape",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde"
},
"to": [
{
"key_code": "escape"
}
]
}
]
},
{
"description": "change left_control + escape to accent`",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"mandatory":[
"left_control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde"
}
]
}
]
},
{
"description": "Change shift escape to grave accent and tilde",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde",
"mandatory":[
"left_shift"
],
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"mandatory":[
"left_shift"
]
}
]
}
]
},
{
"description": "Change caps_lock to control if pressed with other keys, to escape if pressed alone.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "escape"
}
]
}
]
},
{
"description": "Change caps_lock to control if pressed with other keys. (rev 2)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "caps_lock",
"hold_down_milliseconds": 500
}
]
}
]
}
]
}
4.在Complex Modification中增加前三个。Over
本文介绍如何使用Karabiner在Mac上将触控条的虚拟ESC键映射为`键,并将Caps Lock键映射为Ctrl键。通过修改配置文件,实现了对按键功能的自定义调整,以适应不同的编码需求。
141

被折叠的 条评论
为什么被折叠?



