{
  "title": "Programmer Dvorak CmdQwerty Toggle",
  "rules": [
    {
      "description": "While using Programmer Dvorak, holding command temporarily switches to the US qwerty layout.",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "left_command",
            "modifiers": {
              "optional": "any"
            }
          },
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "^.*Programmer Dvorak$"
            	}
              ]
            }
          ],
          "to": [
            {
              "select_input_source": {
                "input_source_id": "^com\\.apple\\.keylayout\\.US$"
              }
            },
            {
              "key_code": "left_command"
            }
          ],
          "to_after_key_up": [
            {
              "select_input_source": {
                "input_source_id": "^.*Programmer Dvorak$"
              }
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "right_command",
            "modifiers": {
              "optional": "any"
            }
          },
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "^.*Programmer Dvorak$"
            	}
              ]
            }
          ],
          "to": [
            {
              "select_input_source": {
                "input_source_id": "^com\\.apple\\.keylayout\\.US$"
              }
            },
            {
              "key_code": "right_command"
            }
          ],
          "to_after_key_up": [
            {
              "select_input_source": {
                "input_source_id": "^.*Programmer Dvorak$"
              }
            }
          ]
        }
      ]
    }
  ]
}

Add Programmer Dvorak CmdQwerty toggle JSON.
Add Programmer Dvorak CmdQwerty toggle JSON.

Unlike the _layout.json variant, which also includes a full mapping from
QWERTY->Programmer Dvorak, this ruleset sits on top of the "native" Programmer
Dvorak layout installed at the operating system level and dynamically
toggles to QWERTY when either command key is pressed.

This has the advantage of letting the user use the standard operating
system layout controls while also preserving QWERTY command shortcuts.
