Skip to content

Instantly share code, notes, and snippets.

@alexpersian
Forked from icanswiftabit/rule.json
Last active January 16, 2021 20:22
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 alexpersian/e146b45ed0f493c11d5cafbb8fe0c425 to your computer and use it in GitHub Desktop.
Save alexpersian/e146b45ed0f493c11d5cafbb8fe0c425 to your computer and use it in GitHub Desktop.
Arrow pad with caps_lock as toggle key
{
"title": "WASD Arrow Keys",
"rules": [
{
"description": "WASD Mode [Capslock as trigger key]",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock"
},
"to": [
{
"set_variable": {
"name": "wasd_key_mode",
"value": 1
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "wasd_key_mode",
"value": 0
}
]
},
{
"type": "basic",
"from": {
"key_code": "caps_lock"
},
"to": [
{
"set_variable": {
"name": "wasd_key_mode",
"value": 0
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "wasd_key_mode",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "wasd_key_mode",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "s",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "wasd_key_mode",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "d",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "wasd_key_mode",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "w",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "wasd_key_mode",
"value": 1
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment