Skip to content

Instantly share code, notes, and snippets.

@valmayaki
Created April 29, 2024 17:34
Show Gist options
  • Save valmayaki/03324ebe000fda3e5273b8a4928400e9 to your computer and use it in GitHub Desktop.
Save valmayaki/03324ebe000fda3e5273b8a4928400e9 to your computer and use it in GitHub Desktop.
Karabiner config for using only mouse for switching between spaces and mission control (virtual modifiers)
{
"description": "Maps button 5 and 4 as modifiers for button 1 and 2 to switch spaces and desktops",
"manipulators": [
{
"type": "basic",
"from": {
"pointing_button": "button4",
"modifiers": {
"mandatory": [],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"pointing_button": "button4"
}
],
"to": [
{
"set_variable": {
"name": "button4_modifier",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "button4_modifier",
"value": 0
}
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button5",
"modifiers": {
"mandatory": [],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"pointing_button": "button5"
}
],
"to": [
{
"set_variable": {
"name": "button5_modifier",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "button5_modifier",
"value": 0
}
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button1",
"modifiers": {
"mandatory": [],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"pointing_button": "button1"
}
],
"to": [
{
"key_code": "left_arrow",
"modifiers": "left_control"
}
],
"conditions": [
{
"type": "variable_if",
"name": "button4_modifier",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button2",
"modifiers": {
"mandatory": [],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"pointing_button": "button2"
}
],
"to": [
{
"key_code": "right_arrow",
"modifiers": "left_control"
}
],
"conditions": [
{
"type": "variable_if",
"name": "button4_modifier",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button1",
"modifiers": {
"mandatory": [],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"pointing_button": "button1"
}
],
"to": [
{
"key_code": "up_arrow",
"modifiers": "left_control"
}
],
"conditions": [
{
"type": "variable_if",
"name": "button5_modifier",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button2",
"modifiers": {
"mandatory": [],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"pointing_button": "button2"
}
],
"to": [
{
"key_code": "down_arrow",
"modifiers": "left_control"
}
],
"conditions": [
{
"type": "variable_if",
"name": "button5_modifier",
"value": 1
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment