{
    "profiles": [
        {
            "complex_modifications": {
                "rules": [
                    {
                        "description": "[FootSwitch] Left pedal → Command (hold)",
                        "enabled": false,
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 45057,
                                                "vendor_id": 13651
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "consumer_key_code": "play_or_pause",
                                    "modifiers": { "optional": ["any"] }
                                },
                                "to": [
                                    {
                                        "key_code": "left_command",
                                        "lazy": true
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[FootSwitch] Middle pedal → Control (hold)",
                        "enabled": false,
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 45057,
                                                "vendor_id": 13651
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": { "optional": ["any"] },
                                    "pointing_button": "button1"
                                },
                                "to": [
                                    {
                                        "key_code": "left_control",
                                        "lazy": true
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[FootSwitch] Right pedal → Tab",
                        "enabled": false,
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 45057,
                                                "vendor_id": 13651
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "consumer_key_code": "scan_previous_track" },
                                "to": [{ "key_code": "tab" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] Middle click → Space (when '1' or '4' held)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "name": "mouse_cmdtab_layer",
                                        "type": "variable_if",
                                        "value": 1
                                    },
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": { "optional": ["any"] },
                                    "pointing_button": "button3"
                                },
                                "to": [{ "key_code": "spacebar" }],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "mouse_ctrl_layer",
                                        "type": "variable_if",
                                        "value": 1
                                    },
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": { "optional": ["any"] },
                                    "pointing_button": "button3"
                                },
                                "to": [{ "key_code": "spacebar" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '6' → F20 (for Wispr Flow)",
                        "enabled": false,
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "6" },
                                "to": [{ "key_code": "f20" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '6' → Backslash (for VoiceFlow)",
                        "enabled": false,
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "6" },
                                "to": [{ "key_code": "backslash" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '3' → Escape",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "3" },
                                "to": [{ "key_code": "escape" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '5' → Enter",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "5" },
                                "to": [{ "key_code": "return_or_enter" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '4' = Control layer (LClick=Ctrl+Tab, RClick=Ctrl+Shift+Tab)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "4" },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "mouse_ctrl_layer",
                                            "value": 1
                                        }
                                    },
                                    { "key_code": "left_control" }
                                ],
                                "to_after_key_up": [
                                    {
                                        "set_variable": {
                                            "name": "mouse_ctrl_layer",
                                            "value": 0
                                        }
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "mouse_ctrl_layer",
                                        "type": "variable_if",
                                        "value": 1
                                    },
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": { "optional": ["any"] },
                                    "pointing_button": "button1"
                                },
                                "to": [{ "key_code": "tab" }],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "mouse_ctrl_layer",
                                        "type": "variable_if",
                                        "value": 1
                                    },
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": { "optional": ["any"] },
                                    "pointing_button": "button2"
                                },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["left_shift"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '2' → Cmd+Tab",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "2" },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '7' → Copy (Cmd+C)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "7" },
                                "to": [
                                    {
                                        "key_code": "c",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '9' → Screenshot to clipboard (Cmd+Ctrl+Shift+4)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "9" },
                                "to": [
                                    {
                                        "key_code": "4",
                                        "modifiers": ["left_command", "left_control", "left_shift"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '0' → Paste (Cmd+V)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "0" },
                                "to": [
                                    {
                                        "key_code": "v",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '8' → Cmd+Shift+A (Chrome tab search)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "8" },
                                "to": [
                                    {
                                        "key_code": "a",
                                        "modifiers": ["left_command", "left_shift"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] keypad_plus → Cmd+` (switch window)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "keypad_plus" },
                                "to": [
                                    {
                                        "key_code": "grave_accent_and_tilde",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] keypad_hyphen → Cmd+Shift+` (reverse switch window)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "keypad_hyphen" },
                                "to": [
                                    {
                                        "key_code": "grave_accent_and_tilde",
                                        "modifiers": ["left_command", "left_shift"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Gaming Mouse] '1' = Command layer (LClick=Cmd+Tab, RClick=Cmd+Shift+Tab)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": { "key_code": "1" },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "mouse_cmdtab_layer",
                                            "value": 1
                                        }
                                    },
                                    { "key_code": "left_command" }
                                ],
                                "to_after_key_up": [
                                    {
                                        "set_variable": {
                                            "name": "mouse_cmdtab_layer",
                                            "value": 0
                                        }
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "mouse_cmdtab_layer",
                                        "type": "variable_if",
                                        "value": 1
                                    },
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": { "optional": ["any"] },
                                    "pointing_button": "button1"
                                },
                                "to": [{ "key_code": "tab" }],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "mouse_cmdtab_layer",
                                        "type": "variable_if",
                                        "value": 1
                                    },
                                    {
                                        "identifiers": [
                                            {
                                                "product_id": 64589,
                                                "vendor_id": 1241
                                            }
                                        ],
                                        "type": "device_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": { "optional": ["any"] },
                                    "pointing_button": "button2"
                                },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["left_shift"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "New Rule (change left_shift+caps_lock to page_down, right_shift+caps_lock to left_command+mission_control)",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "caps_lock",
                                    "modifiers": {
                                        "mandatory": ["left_shift"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "page_down",
                                        "modifiers": []
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "key_code": "caps_lock",
                                    "modifiers": {
                                        "mandatory": ["right_shift"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "apple_vendor_keyboard_key_code": "mission_control",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Aqua Voice: ⌥(R)+⌘(L)+⇧(L)+F19 → ⌥(R)+⌘(L)+⇧(L)+F7",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "f19",
                                    "modifiers": {
                                        "mandatory": ["right_option", "right_command", "left_shift"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "f7",
                                        "modifiers": ["right_option", "right_command", "left_shift"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Cmd+= → Cmd+` (switch window), Cmd+Shift+= → Cmd+Shift+` (reverse), Cmd+Opt+= → normal zoom in",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "equal_sign",
                                    "modifiers": {
                                        "mandatory": ["command", "option"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "equal_sign",
                                        "modifiers": ["command"]
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "key_code": "equal_sign",
                                    "modifiers": {
                                        "mandatory": ["command", "shift"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "grave_accent_and_tilde",
                                        "modifiers": ["command", "shift"]
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "key_code": "equal_sign",
                                    "modifiers": {
                                        "mandatory": ["command"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "grave_accent_and_tilde",
                                        "modifiers": ["command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Cmd + . / Cmd + Shift + . → Cmd + Tab / Cmd + Shift + Tab (but NOT Cmd+Opt+Shift+.)",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "period",
                                    "modifiers": {
                                        "mandatory": ["command", "option", "shift"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "period",
                                        "modifiers": ["command", "option", "shift"]
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "key_code": "period",
                                    "modifiers": {
                                        "mandatory": ["command", "shift"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["command", "shift"]
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "key_code": "period",
                                    "modifiers": {
                                        "mandatory": ["command"],
                                        "optional": ["any"]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Remap right_option to f19",
                        "enabled": false,
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "right_option",
                                    "modifiers": { "optional": ["any"] }
                                },
                                "to": [{ "key_code": "f19" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Change middle click (button3) to Command+Tab (App Switcher)",
                        "enabled": false,
                        "manipulators": [
                            {
                                "from": { "pointing_button": "button3" },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Left + Right mouse click simultaneously → Command+Tab",
                        "manipulators": [
                            {
                                "from": {
                                    "simultaneous": [
                                        { "pointing_button": "button1" },
                                        { "pointing_button": "button2" }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "insensitive",
                                        "key_up_order": "insensitive",
                                        "key_up_when": "any"
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Change right opt, to Command + Tab",
                        "enabled": false,
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "right_option",
                                    "modifiers": {}
                                },
                                "to": [
                                    {
                                        "key_code": "tab",
                                        "modifiers": ["left_command"]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[ElfKey] F20 → fn (for Wispr Flow)",
                        "enabled": false,
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "f20",
                                    "modifiers": { "optional": ["any"] }
                                },
                                "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "[Test] 5 → F20",
                        "enabled": false,
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "5",
                                    "modifiers": { "optional": ["any"] }
                                },
                                "to": [{ "key_code": "f17" }],
                                "type": "basic"
                            }
                        ]
                    }
                ]
            },
            "devices": [
                {
                    "identifiers": {
                        "is_pointing_device": true,
                        "product_id": 45057,
                        "vendor_id": 13651
                    },
                    "ignore": false
                },
                {
                    "identifiers": {
                        "is_pointing_device": true,
                        "product_id": 64589,
                        "vendor_id": 1241
                    },
                    "ignore": false
                },
                {
                    "identifiers": {
                        "is_pointing_device": true,
                        "product_id": 768,
                        "vendor_id": 12538
                    },
                    "ignore": false
                },
                {
                    "identifiers": {
                        "is_keyboard": true,
                        "product_id": 50484,
                        "vendor_id": 1133
                    },
                    "simple_modifications": [
                        {
                            "from": { "key_code": "left_command" },
                            "to": [{ "key_code": "left_option" }]
                        },
                        {
                            "from": { "key_code": "left_option" },
                            "to": [{ "key_code": "left_command" }]
                        },
                        {
                            "from": { "key_code": "right_command" },
                            "to": [{ "key_code": "right_option" }]
                        },
                        {
                            "from": { "key_code": "right_control" },
                            "to": [{ "key_code": "right_option" }]
                        },
                        {
                            "from": { "key_code": "right_option" },
                            "to": [{ "key_code": "right_command" }]
                        }
                    ]
                },
                {
                    "identifiers": {
                        "is_keyboard": true,
                        "product_id": 108,
                        "vendor_id": 1226
                    },
                    "simple_modifications": [
                        {
                            "from": { "key_code": "right_control" },
                            "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
                        }
                    ]
                },
                {
                    "identifiers": {
                        "is_keyboard": true,
                        "product_id": 64589,
                        "vendor_id": 1241
                    },
                    "simple_modifications": [
                        {
                            "from": { "key_code": "6" },
                            "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
                        }
                    ]
                }
            ],
            "name": "Default profile",
            "selected": true,
            "simple_modifications": [
                {
                    "from": { "key_code": "backslash" },
                    "to": [{ "key_code": "backslash" }]
                },
                {
                    "from": { "key_code": "caps_lock" },
                    "to": [{ "key_code": "return_or_enter" }]
                },
                {
                    "from": { "key_code": "f20" },
                    "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
                }
            ],
            "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" }
        }
    ]
}