当我单击另一个按钮时,我想使用鼠标上的一个按钮作为修饰符。
我发现了这个https://github.com/tekezo/Karabiner-Elements/issues/1223但由于不活动而关闭。
我曾尝试在定义中同时使用,但它不起作用。
{
"description": "Maps button6 and button3 to close action (cmd-w)",
"manipulators": [
{
"from": {
"modifiers": [
{
"pointing_button": "button6"
}
],
"pointing_button": "button3"
},
"to": [
{
"key_code": "w",
"modifiers": [
"left_command"
],
"repeat": false
}
],
"type": "basic"
}
]
}
任何想法如何做到这一点?
编辑:
我最终这样做了:
{
"description": "Maps button2 to close action (cmd-w) when button6 is pressed",
"manipulators": [
{
"conditions": [
{
"type": "variable_if",
"name": "button6_down",
"value": 1
}
],
"from": {
"pointing_button": "button2"
},
"to": [
{
"key_code": "w",
"modifiers": [
"left_command"
],
"repeat": false
}
],
"type": "basic"
}
]
},
{
"description": "Maps button6 to variable",
"manipulators": [
{
"from": {
"pointing_button": "button6"
},
"to": [
{
"set_variable": {
"name": "button6_down",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "button6_down",
"value": 0
}
}
],
"type": "basic"
}
]
}
to_after_key_up
显然也适用于鼠标按钮