pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.59k stars 835 forks source link

How can I bind "FN+X" to "L_SHIFT + L_CTRL + L_ALT + L_CMD"? (aka hyper mod key) #2121

Closed rublev closed 4 years ago

rublev commented 4 years ago

I would post some code but I've been trying for hours to get literally anything working and I'm struggling lol.

I want to bind the hyper key combo to just FN+X so then I can do things like FN+X+ in SKHD to control my yabai window manager without having to press SHIFT+CTRL+ALT+CMD+ which is way more presses.

I have a 60% pok3r keyboard and I can't figure out how to bind this key combo so I thought I'd use karabiner to do the same.

edit: I have the following in my karabiner.json but it doesn't do anything:

"complex_modifications": {
    "parameters": {
        "basic.simultaneous_threshold_milliseconds": 50,
        "basic.to_delayed_action_delay_milliseconds": 500,
        "basic.to_if_alone_timeout_milliseconds": 1000,
        "basic.to_if_held_down_threshold_milliseconds": 500,
        "mouse_motion_to_scroll.speed": 100
    },
    "rules": [
        {
            "manipulators": [
                {
                    "description": "Change x to hyper.",
                    "from": {
                        "key_code": "x",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "left_shift",
                            "modifiers": [
                                "left_alt",
                                "left_command",
                                "left_control",
                            ]
                        }
                    ],
                    "type": "basic"
                }
            ]
        }
    ]
},

edit 2: this works well but its still annoying.

"complex_modifications": {
                "rules": [
                    {
                        "manipulators": [
                            {
                                "description": "Change left_ctrl aka caps lock to command+control+option+shift. left_ctrl if no other key used.",
                                "from": {
                                    "key_code": "left_control",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to_if_held_down": [
                                    {
                                        "key_code": "left_shift",
                                        "modifiers": [
                                            "left_command",
                                            "left_control",
                                            "left_option"
                                        ]
                                    }
                                ],
                                 "parameters": {
                                    "basic.to_if_alone_timeout_milliseconds": 250,
                                    "basic.to_if_held_down_threshold_milliseconds": 250
                                },
                                "to_if_alone": [
                                    {
                                        "key_code": "left_control",
                                        "modifiers": [
                                            "any"
                                        ]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    }
                ]
            },

edit 3: i think i got it working. now if i press FN+X+ENTER (rebound lctrl to fn on my pok3r) it reads my skhd config and opens iterm!

            "complex_modifications": {
                "rules": [
                    {
                        "manipulators": [
                            {
                                "description": "Change left_ctrl aka caps lock to command+control+option+shift. left_ctrl if no other key used.",
                                "from": {
                                    "key_code": "x",
                                    "modifiers": {
                                        "optional": [
                                            "fn"
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.to_if_alone_timeout_milliseconds": 0,
                                    "basic.to_if_held_down_threshold_milliseconds": 0
                                },
                                "to_if_held_down": [
                                    {
                                        "key_code": "left_shift",
                                        "modifiers": [
                                            "left_command",
                                            "left_control",
                                            "left_option"
                                        ]
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    }
                ]
            },

Can anyone help me out? Thanks!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.