Last active
August 15, 2024 18:30
-
-
Save icanswiftabit/f91413052a95ad3f0ecf43ad9cfc0d53 to your computer and use it in GitHub Desktop.
Arrow pad with caps_lock as toggle key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Arrow Key Pad", | |
"rules": [ | |
{ | |
"description": "Arrow Keypad Mode [Capslock as trigger key]", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "caps_lock" | |
}, | |
"to": [ | |
{ | |
"set_variable": { | |
"name": "arrow_key_mode", | |
"value": 1 | |
} | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "variable_if", | |
"name": "arrow_key_mode", | |
"value": 0 | |
} | |
] | |
}, | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "caps_lock" | |
}, | |
"to": [ | |
{ | |
"set_variable": { | |
"name": "arrow_key_mode", | |
"value": 0 | |
} | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "variable_if", | |
"name": "arrow_key_mode", | |
"value": 1 | |
} | |
] | |
}, | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "j", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "left_arrow" | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "variable_if", | |
"name": "arrow_key_mode", | |
"value": 1 | |
} | |
] | |
}, | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "k", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "down_arrow" | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "variable_if", | |
"name": "arrow_key_mode", | |
"value": 1 | |
} | |
] | |
}, | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "l", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "right_arrow" | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "variable_if", | |
"name": "arrow_key_mode", | |
"value": 1 | |
} | |
] | |
}, | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "i", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "up_arrow" | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "variable_if", | |
"name": "arrow_key_mode", | |
"value": 1 | |
} | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this. I'm going to see if I can have a global VIM mode within macOS.