Created
November 26, 2018 02:50
-
-
Save fengye/da9e3ab00df9ac0acbb384361bd8a1e4 to your computer and use it in GitHub Desktop.
CursorMode-karabiner.json
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
{ | |
"description": "Double click ESC to toggle cursor mode. ", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"name": "cursor_mode_trigger_key_pressed", | |
"type": "variable_if", | |
"value": 1 | |
}, | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 0 | |
} | |
], | |
"from": { | |
"key_code": "escape", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"set_variable": { | |
"name": "is_cursor_mode_on", | |
"value": 1 | |
} | |
}, | |
{ | |
"shell_command": "osascript -e 'display notification \"Cursor mode ON.\" with title \"Keyboard\" sound name \"Frog\"'" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "cursor_mode_trigger_key_pressed", | |
"type": "variable_if", | |
"value": 1 | |
}, | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "escape", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"set_variable": { | |
"name": "is_cursor_mode_on", | |
"value": 0 | |
} | |
}, | |
{ | |
"shell_command": "osascript -e 'display notification \"Cursor mode OFF.\" with title \"Keyboard\" sound name \"Frog\"'" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"from": { | |
"key_code": "escape", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"set_variable": { | |
"name": "cursor_mode_trigger_key_pressed", | |
"value": 1 | |
} | |
}, | |
{ | |
"key_code": "escape" | |
} | |
], | |
"to_delayed_action": { | |
"to_if_canceled": [ | |
{ | |
"set_variable": { | |
"name": "cursor_mode_trigger_key_pressed", | |
"value": 0 | |
} | |
} | |
], | |
"to_if_invoked": [ | |
{ | |
"set_variable": { | |
"name": "cursor_mode_trigger_key_pressed", | |
"value": 0 | |
} | |
} | |
] | |
}, | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "j", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "left_arrow" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "l", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "right_arrow" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "i", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "up_arrow" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "k", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "down_arrow" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "u", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "a", | |
"modifiers": [ | |
"left_control", | |
"right_control" | |
] | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "o", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "e", | |
"modifiers": [ | |
"left_control", | |
"right_control" | |
] | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "p", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "a", | |
"modifiers": [ | |
"left_control", | |
"right_control" | |
] | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "semicolon", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "e", | |
"modifiers": [ | |
"left_control", | |
"right_control" | |
] | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "open_bracket", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "page_up" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "quote", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "page_down" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "spacebar" | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "a", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "b", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "c", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "d", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "e", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "f", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "g", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "h", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "m", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "n", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "comma", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "period", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "close_bracket", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "backslash", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "slash", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "q", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "r", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "s", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "t", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "v", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "w", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "x", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "y", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "z", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "1", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "2", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "3", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "4", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "5", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "6", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "7", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "8", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "9", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "0", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "hyphen", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"name": "is_cursor_mode_on", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "equal_sign", | |
"modifiers": { | |
"optional": [ | |
"shift" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "vk_none" | |
} | |
], | |
"type": "basic" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment