Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{"title": "Mission control, elaborate",
"rules":[
{ "description": "Mission control, elaborate; requires Ctrl, Shft & arrows. Was created to make movements in Mission Control 'key-able', but works in all apps.",
"manipulators": [
{ "from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
{ "mouse_key": {"x": 3072} },
{ "mouse_key": {"x": 3072} },
{ "mouse_key": {"x": 3072} },
{ "mouse_key": {"x": 3072} },
{ "mouse_key": {"x": 3072} },
{ "mouse_key": {"x": 3072} },
{ "mouse_key": {"x": 3072} },
{ "mouse_key": {"x": 3072},
"repeat": false }
],
"type": "basic"
},
{ "from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
{ "mouse_key": {"x": -3072} },
{ "mouse_key": {"x": -3072} },
{ "mouse_key": {"x": -3072} },
{ "mouse_key": {"x": -3072} },
{ "mouse_key": {"x": -3072} },
{ "mouse_key": {"x": -3072} },
{ "mouse_key": {"x": -3072} },
{ "mouse_key": {"x": -3072},
"repeat": false }
],
"type": "basic"
},
{ "from": {
"key_code": "down_arrow",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
{ "mouse_key": {"y": 3072} },
{ "mouse_key": {"y": 3072} },
{ "mouse_key": {"y": 3072} },
{ "mouse_key": {"y": 3072} },
{ "mouse_key": {"y": 3072} },
{ "mouse_key": {"y": 3072} },
{ "mouse_key": {"y": 3072} },
{ "mouse_key": {"y": 3072},
"repeat": false }
],
"type": "basic"
},
{ "from": {
"key_code": "up_arrow",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
{ "mouse_key": {"y": -3072} },
{ "mouse_key": {"y": -3072} },
{ "mouse_key": {"y": -3072} },
{ "mouse_key": {"y": -3072} },
{ "mouse_key": {"y": -3072} },
{ "mouse_key": {"y": -3072} },
{ "mouse_key": {"y": -3072} },
{ "mouse_key": {"y": -3072},
"repeat": false }
],
"type": "basic"
},
{
"from": {
"key_code": "return_or_enter",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
{ "pointing_button": "button1" } ],
"type": "basic"
}
] } ] }
@clemsam

This comment has been minimized.

Copy link
Owner Author

@clemsam clemsam commented Oct 17, 2018

The above code, imported into Karabiner Elements' "Complex Modifications", makes your cursor "jump" via arrow-key-directing –
IF Shift and Control are pressed along with them.
Unfortunately "Mission Control" does NOT react to any shortcuts (except to change Spaces).

This script will be effective in every application (otherwise –for ONLY Mission-Control– I'd have reduced keys pressed to arrow keys)…
… as Mission-Control's "frontmost_application" is always the one selected before (and in) M-C, I could not make an M-C-only script.)

The amount of repeated "mouse_key"s should be adapted individually to suit your mouse-velocity and screen resolution
(e.g.: cut 1 or more complete "mouse_key" lines to shorten the jump; do so for each direction).
Max values for "mouse_key" "x" and "y" are (pos.&neg.) 3072; higher values devaluate these numbers in crazy ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment