Skip to content

Instantly share code, notes, and snippets.

@tylerfowle
Created April 18, 2018 15:13
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 tylerfowle/71a4907d101352d5b5fc4d13102409e9 to your computer and use it in GitHub Desktop.
Save tylerfowle/71a4907d101352d5b5fc4d13102409e9 to your computer and use it in GitHub Desktop.
Examples of complex Karabiner Elements configs

Virtual Modifiers

Use variable_if to accomplish the virtual modifiers. The following example uses tab_modifier variable as flag.

{
    "manipulators": [
        {
            "from": {
                "key_code": "tab"
            },
            "to": [
                {
                    "set_variable": {
                        "name": "tab_modifier",
                        "value": 1
                    }
                },
                {
                    "key_code": "tab"
                }
            ],
            "to_after_key_up": [
                {
                    "set_variable": {
                        "name": "tab_modifier",
                        "value": 0
                    }
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "type": "variable_if",
                    "name": "tab_modifier",
                    "value": 1
                }
            ],
            "from": {
                "key_code": "c"
            },
            "to": [
                {
                    "key_code": "t"
                },
                {
                    "key_code": "a"
                },
                {
                    "key_code": "b"
                }
            ],
            "type": "basic"
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment