Skip to content

Instantly share code, notes, and snippets.

@Maysora
Last active April 10, 2023 14:09
Show Gist options
  • Save Maysora/cc0dd0f763c5833d744fd103b8ebb477 to your computer and use it in GitHub Desktop.
Save Maysora/cc0dd0f763c5833d744fd103b8ebb477 to your computer and use it in GitHub Desktop.
Karabiner complex mod for arrow keys on MacOS
{
"title": "Caps Lock to arrow keys",
"rules": [
{
"description": "Caps Lock as modifier (required, pick one)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
},
{
"set_notification_message": {
"id": "caps_mode",
"text": "Arrow Mode"
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
},
{
"set_variable": {
"name": "numpad mode",
"value": 0
}
},
{
"set_notification_message": {
"id": "caps_mode",
"text": ""
}
}
]
}
]
},
{
"description": "Caps Lock as toggle (required, pick one)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
},
{
"set_notification_message": {
"id": "caps_mode",
"text": "Arrow Mode"
}
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_unless",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
},
{
"set_variable": {
"name": "numpad mode",
"value": 0
}
},
{
"set_notification_message": {
"id": "caps_mode",
"text": ""
}
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
]
}
]
},
{
"description": "Caps Lock + ijkl to arrow keys",
"manipulators": [
{
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_unless",
"value": 1
}
],
"type": "basic"
},
{
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_unless",
"value": 1
}
],
"type": "basic"
},
{
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_unless",
"value": 1
}
],
"type": "basic"
},
{
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_unless",
"value": 1
}
],
"type": "basic"
}
]
},
{
"description": "Caps Lock + uo to command+left/right",
"manipulators": [
{
"from": {
"key_code": "u",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["left_command"]
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_unless",
"value": 1
}
],
"type": "basic"
},
{
"from": {
"key_code": "o",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["left_command"]
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_unless",
"value": 1
}
],
"type": "basic"
}
]
},
{
"description": "Caps Lock + return to Caps Lock",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "return_or_enter",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
}
]
},
{
"description": "Caps Lock + a to Caps Lock",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
}
]
},
{
"description": "Caps Lock + ` to Caps Lock",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
}
]
},
{
"description": "Caps Lock + n to Numpad Mode",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "n",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "numpad mode",
"value": 1
}
},
{
"set_notification_message": {
"id": "caps_mode",
"text": "Numpad Mode"
}
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_unless",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "n",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "numpad mode",
"value": 0
}
},
{
"set_notification_message": {
"id": "caps_mode",
"text": "Arrow Mode"
}
}
],
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
},
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
]
}
]
},
{
"description": "Numpad mode [space]m,.jkluio to 0-9",
"manipulators": [
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "m",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "1"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "comma",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "2"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "period",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "3"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "4"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "5"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "6"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "u",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "7"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "8"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "9"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "0"
}
],
"type": "basic"
}
]
},
{
"description": "Numpad mode ;' to ,.",
"manipulators": [
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "comma"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "numpad mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "quote",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "period"
}
],
"type": "basic"
}
]
}
]
}
{
"title": "Left command to arrow keys on SublimeText",
"rules": [
{
"description": "Left command + ijkl to arrow keys on ST",
"manipulators": [
{
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"sublimetext"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"sublimetext"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"sublimetext"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"sublimetext"
]
}
],
"type": "basic"
}
]
},
{
"description": "Left command + uo to command+left/right on ST",
"manipulators": [
{
"from": {
"key_code": "u",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["left_command"]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"sublimetext"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "o",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["left_command"]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"sublimetext"
]
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment