I would like to use a button on the mouse as a modifier for when I click another button.
I found this https://github.com/tekezo/Karabiner-Elements/issues/1223 but it was closed due to inactivity.
I have tried to use simultaneous in the from definition but it does not work.
{
"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"
}
]
}
Any ideas how to do this?
edit:
I ended up doing it like this:
{
"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"
}
]
}
The to_after_key_up
apparently works for mouse buttons as well