Search code examples
karabiner

karabiner elements json: how to make 'left_option" + "up_arrow" to "up_arrow" x 10?


The title says it all. One more information is that I use apple wired keyboard with macbook pro - "clam shell is closed" while external monitors are attached. I added the following at the correct file, but doesn't work. I want to use it for Xcode and Visual Studio Code, etc.

{
                        "description": "Move Up / Down 10",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "up_arrow"
                                },
                                "to": [
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    }
                                ]
                            }
                        ]
                    }

Solution

  • Two things, first you forgot to add "type": "basic" Second: you must add "modifiers": {"mandatory": ["left_option"]}

    { "description": "Move Up / Down 10", "manipulators": [ { "type": "basic", "from": { "key_code": "up_arrow", "modifiers": {"mandatory": ["left_option"]} }, "to": [ { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" }, { "key_code": "up_arrow" } ] } ] }