karabiner.json data structure

karabiner.json

{
    "global": {
        "check_for_updates_on_startup": true,
        "show_in_menu_bar": true,
        "show_profile_name_in_menu_bar": false
    },
    "profiles": [
        {
            "name": "Profile name",
            "selected": true,
            "simple_modifications": [
                ...
            ],
            "fn_function_keys": [
                ...
            ],
            "complex_modifications": {
                "parameters": {
                    ...
                },
                "rules": [
                    ...
                ]
            },
            "virtual_hid_keyboard": {
                "keyboard_type": "ansi",
                "caps_lock_delay_milliseconds": 0
            },
            "devices": [
                ...
            ],
            "parameters": {
                ...
            }
        },
        {
            "name": "Profile name",
            "selected": false,
            ...
        },
        ...
    ]
}

complex_modifications in karabiner.json > profiles

{
    "complex_modifications": {
        "parameters": {
            ...
        },
        "rules": [
            {
                "description": "This description is shown in Settings.",
                "manipulators": [
                    {
                        "type": "basic",

                        "from": from event definition,

                        "to": [
                            to event definition,
                            to event definition,
                            ...
                        ],

                        "to_if_alone": [
                            to event definition,
                            to event definition,
                            ...
                        ],

                        "to_if_held_down": [
                            to event definition,
                            to event definition,
                            ...
                        ],

                        "to_after_key_up": [
                            to event definition,
                            to event definition,
                            ...
                        ],

                        "to_delayed_action": {
                            "to_if_invoked": [
                                to event definition,
                                to event definition,
                                ...
                            ],
                            "to_if_canceled": [
                                to event definition,
                                to event definition,
                                ...
                            ]
                        },

                        "conditions": [
                            condition definition,
                            condition definition,
                            ...
                        ],

                        "parameters": {
                            ...
                        },

                        "description": "Optional description for human"
                    },
                    {
                        "type": "basic",
                        ...
                    },
                    ...
                ]
            },
            {
                "description": "...",
                "manipulators": [
                    ...
                ]
            },
            ...
        ]
    }
}

custom *.json file in ~/config/karabiner/assets/complex_modifications

{
    "title": "Title for the list of rules/complex modifications.",
    "rules": [
        {
            "description": "This description is shown in Settings.",
            "manipulators": [
                {
                    "type": "basic",

                    "from": from event definition,

                    "to": [
                        to event definition,
                        to event definition,
                        ...
                    ],

                    "to_if_alone": [
                        to event definition,
                        to event definition,
                        ...
                    ],

                    "to_if_held_down": [
                        to event definition,
                        to event definition,
                        ...
                    ],

                    "to_after_key_up": [
                        to event definition,
                        to event definition,
                        ...
                    ],

                    "to_delayed_action": {
                        "to_if_invoked": [
                            to event definition,
                            to event definition,
                            ...
                        ],
                        "to_if_canceled": [
                            to event definition,
                            to event definition,
                            ...
                        ]
                    },

                    "conditions": [
                        condition definition,
                        condition definition,
                        ...
                    ],

                    "parameters": {
                        ...
                    },

                    "description": "Optional description for human"
                },
                {
                    "type": "basic",
                    ...
                },
                ...
            ]
        },
        {
            "description": "...",
            "manipulators": [
                ...
            ]
        },
        ...
    ]
}