How to map “Spacebar + 1” to “⌃1” on Karabiner Elements

karabinerkeybindingskeyboard

I'm looking for a way to remap Spacebar as a modifier for only the number row. For example, Spacebar + 0 = ⌃0, but for anything else Spacebar is just Spacebar.

I found this post which does what I I want through the example of M + N. Unfortunately, it's for an older version of Karabiner, and I don't understand how this code translates to the current way the program works.

Best Answer

It was actually quite easy. From an example given on the page, I modified it so that Spcebar + 1 = terminal command. Works fairly well. Use Karabiner Event Viewer to know the name of the key you want to add, and place this as a .json file on .config > karabiner > assets > complex_modifications

{
    "title": "Spacebar + 1",
    "rules": [        
        {
            "description": "Spacebar + 1",
            "manipulators": [
                {
                    "type": "basic",
                    "from": {
                        "simultaneous": [
                            {
                                "key_code": "spacebar"
                            },
                            {
                                "key_code": "1"
                            }
                        ],
                        "modifiers": {
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "shell_command": "open /Users/"
                        }
                    ]
                }
            ]
        }
    ]
}