kennir
2023-08-31 16:08:01 +08:00
如果你的鼠标侧键可以被 karabiner-element 检测到的话, 可以通过 karabiner-element 的 complex-modification 根据当前 app 修改侧键功能
例如下面这个可以针对 vscode 修改侧键的功能
```
{
"title": "Razer orochi v2 for common navigate",
"rules": [
{
"description": "navigate back and forward",
"manipulators": [
{
"type": "basic",
"from": {
"pointing_button": "button4"
},
"to": [
{
"repeat": false,
"key_code": "open_bracket",
"modifiers": [
"left_gui"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"com.microsoft.VSCode"
]
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button5"
},
"to": [
{
"repeat": false,
"key_code": "close_bracket",
"modifiers": [
"left_gui"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"com.microsoft.VSCode"
]
}
]
}
]
},
{
"description": "navigate between tabs",
"manipulators": [
{
"type": "basic",
"from": {
"pointing_button": "button4",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"repeat": false,
"key_code": "tab",
"modifiers": [
"left_control"
]
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button5",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"repeat": false,
"key_code": "tab",
"modifiers": [
"left_control",
"left_shift"
]
}
]
}
]
}
]
}
```