{
  "title": "ipatch, stackoverflow capslock toggle EXP",
  "rules": [
    {
      "description": "WASD arrow Keys toggled by Capslock",
      "manipulators": [
        {
          "type": "basic",
          "description": "",
          "from": {
            "key_code": "w",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "up_arrow"

            }
          ],
          "conditions": [
            {
              "type": "variable_if",
              "name": "caps_lock pressed",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "description": "",
          "from": {
            "key_code": "s",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "down_arrow"

            }
          ],
          "conditions": [
            {
              "type": "variable_if",
              "name": "caps_lock pressed",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "description": "",
          "from": {
            "key_code": "a",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow"

            }
          ],
          "conditions": [
            {
              "type": "variable_if",
              "name": "caps_lock pressed",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "description": "",
          "from": {
            "key_code": "d",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow"

            }
          ],
          "conditions": [
            {
              "type": "variable_if",
              "name": "caps_lock pressed",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },

          "to": [
            {
              "key_code": "caps_lock"
            },

            {
              "set_variable": {
                "name": "caps_lock pressed",
                "value": 0
              }
            }
          ],
          "conditions": [
            {
              "type": "variable_if",
              "name": "caps_lock pressed",
              "value": 1
            }
          ]

        },

        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },

          "to": [
            {
              "key_code": "caps_lock"
            }
          ],
          "to_if_alone": [
            {
              "set_variable": {
                "name": "caps_lock pressed",
                "value": 1
              }
            }
          ]
        }
      ]
    }
  ]
}

