Skip to content

Instantly share code, notes, and snippets.

@pokutuna
Created December 25, 2018 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pokutuna/25324a2a61196692023db2790b8b8f43 to your computer and use it in GitHub Desktop.
Save pokutuna/25324a2a61196692023db2790b8b8f43 to your computer and use it in GitHub Desktop.
s+d
{
"title": "mousekey(s+d)",
"rules": [
{
"description": "mousekey(s+d)",
"manipulators": [
{
"type": "basic",
"from": {
"simultaneous": [
{ "key_code": "s" },
{ "key_code": "d" }
],
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "enable_mousekey",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "enable_mousekey",
"value": 0
}
}
]
},
{
"type": "basic",
"from": {
"key_code": "h",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"horizontal_wheel": 32
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
},
{
"type": "variable_if",
"name": "enable_mousekey_scroll",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"vertical_wheel": 32
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
},
{
"type": "variable_if",
"name": "enable_mousekey_scroll",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"vertical_wheel": -32
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
},
{
"type": "variable_if",
"name": "enable_mousekey_scroll",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"horizontal_wheel": -32
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
},
{
"type": "variable_if",
"name": "enable_mousekey_scroll",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "h",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"x": -2048
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"y": 2048
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"y": -2048
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"x": 2048
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"pointing_button": "button1"
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"pointing_button": "button3"
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_command",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"pointing_button": "button2"
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "a",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"mouse_key": {
"speed_multiplier": 2.5
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "f",
"modifiers": {
"mandatory": [
"s",
"d"
],
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "enable_mousekey_scroll",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "enable_mousekey_scroll",
"value": 0
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "enable_mousekey",
"value": 1
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment