Introduction
一直使用的 Win 平台的 CAPSLock+ 巨好用, 但是换到 Mac 上只能使用对应的付费版本 Capslox, 付费也只是一年的更新, 最后一个免费版本在 Mac Monterey 版本系统上已经废掉.
经过万能的 Google & V2ex & Github, 终于找到一个可以代替 99% 功能的解决方案: karabiner-elements 一款复杂的按键映射工具!
Install
直接brew install
instructions
Karabiner-Elements complex_modifications rules
自定义规则需要放在此目录下, 才能在 karabiner 中手动添加.
~/.config/karabiner/assets/complex_modifications/
注意使用这套规则时, 如果要外接键盘,需要将command键与option键互换,因为键盘一般是对应着 windows 的键位来的, win(也就是command) & alt(option) 与 mac是相反的.
code
{
"title": "capslox - my",
"version": "1.0.0",
"rules": [
{
"description": "Capslock赋能",
"manipulators": [
{
"description": "Capslock键设置为Hyper键",
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "right_shift",
"modifiers": ["right_command", "right_control", "right_option"]
}
],
"to_if_alone": [
{
"key_code": "caps_lock",
"modifiers": ["left_control"]
}
]
},
{
"description": "Capslock + Esc = 切换大小写",
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": {
"optional": ["caps_lock"],
"mandatory": [
"right_command",
"right_control",
"right_shift",
"right_option"
]
}
},
"to": [
{
"key_code": "caps_lock",
"modifiers": ["left_control"]
}
]
},
{
"description": "Capslock + SpaceBar = Enter",
"type": "basic",
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"right_command",
"right_control",
"right_shift",
"right_option"
]
}
},
"to": [
{
"key_code": "return_or_enter"
}
]
}
]
},
{
"description": "光标移动",
"manipulators": [
{
"from": {
"description": "Capslock + E = 向上移动",
"key_code": "e",
"modifiers": {
"mandatory": [
"right_command",
"right_control",
"right_shift",
"right_option"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"from": {
"description": "Capslock + D = 向下移动",
"key_code": "d",
"modifiers": {
"mandatory": [
"right_command",
"right_control",
"right_shift",
"right_option"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"from": {
"description": "Capslock + S = 向左移动",
"key_code": "s",
"modifiers": {
"mandatory": [
"right_command",
"right_control",
"right_shift",
"right_option"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"from": {
"description": "Capslock + F = 向右移动",
"key_code": "f",
"modifiers": {
"mandatory": [
"right_command",
"right_control",
"right_shift",
"right_option"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"from": {
"description": "Capslock + A = 向左移动一个单词",
"key_code": "a",
"modifiers": {
"mandatory": [
"right_command",
"right_control",
"right_shift",
"right_option"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": <