Hyper Key without Karabiner Elements

Does anyone know of a way to remap my caps lock key into cmd+opt+ctrl+shift (hyper key) without the use of Karabiner?

Karabiner has always made my MacBook do weird things like screen glitches on startup and other weird things like that. I would prefer not to use it.

I appreciate any help.

Try this approach.

1 Like

I hadnā€™t seen that. Very cool. Iā€™ve bookmarked it in case I ever need it.

The only issue for me would be that this method is not quite the hyper key:

If your only use case for Karabiner is to remap the Caps Lock key - you may be able to use the OS X native hidutil utility to achieve the same result.

For example, the code below remaps the Caps Lock key to F18.

That is only Ā½ of what the hyper-key does for me:

  1. When Caps Lock is pressed by itself = F18
  2. When Caps Lock is pressed in addition to other keys = āŒ˜ā‡§āŒƒāŒ„

The second option is, to me at least, most important than the first. I have all of my ā€œglobalā€ shortcuts (which work regardless of what app is front-most) bound to Caps Lock + {key}.

You canā€™t use F18 + {key} the same way.

The hidutil method is just ā€œRemapping Caps Lock key to another keyā€ which might be enough for some folks, but isnā€™t really what I suspect most people want with a true hyper key.

5 Likes

Yea I would be using it for the second option too for the ease of mind that Iā€™m not messing with any other keyboard shortcuts from other apps or native to macOS.

Basically all my keyboard maestro macros are triggered by CAPS LOCK (aka cmd+opt+ctrl+shift) and another letter key.

Are you saying that this hammerspoon method will not work like that?

Thatā€™s the nearest option I could find, and I agree, it isnā€™t a great match, but then I donā€™t think anything can be.

The thing is, Karabiner is doing some low-level wizardry, and it is the only thing that Iā€™ve ever come across that goes down to that level to do this sort of thing. Everything else Iā€™ve ever seen always piggy-backs the work being done and has Karabiner as a prerequisite.

Personally, Iā€™ve never used Karabiner. I rely on my more traditional key combinations, Alfred workflows, Keyboard Maestro palettes, a Stream Deck and/or Touch Bar (Better Touch Tool FTW!). Iā€™ve got so many ways to trigger so many things (often multiple ways), that the cognitive load of adding a hyper-key with Karabiner and just the fundamental need over the hundred of options have just never taken me down that path.

As it happens, I also *really* donā€™t like the idea of something poking around at that level without it being part of the OS or being developed in part with Apple. I remember some of the really low-level stuff I used to use at work on Windows that IBM developed in partnership with Microsoft, and even that caused headaches in the real world a lot of the time. I donā€™t want those headaches any more, and this sort of app can definitely affect system-stability, which is presumably what the OP has experienced.

The issue log on GitHub also makes for very interesting reading. While it is very powerful, the developers are absolutely doing some great work, and it is an app beloved of many of the Internetā€™s more prominent Mac users, including yourself, some of the issues that seem to make it through put it in the ā€˜too riskyā€™ bucket for me.

You should be able to use Hammerspoon, I just think it brings with it a fair bit of extra configuration maintenance.

Okay great! Iā€™ll check it out. Thanks.

I might be mistaken, but I thought that I recalled that Hammerspoon had to be configured for Hyper Key in each application. However, I am not sure that is accurate or just something that I (mis)read awhile ago. I was about to try to set it up when Karabiner was released for Big Sur.

Okay so I was able to bind Caps Lock to F18 and created the launch agent so that this stays after reboot. I am kind of lost on how to bind F18 to the four other keys (cmd+opt+control+shift) via Hammerspoon tho.

You know what? I am just starting to realize this might be a little past my level of expertise lol.

I think you might be right. At least, with my very limited knowledge, it seems to be that way.

You have to set-up more stuff with Hammerspoon. Take a look at Brett Terpstraā€™s old config and some of the config posted by others in the comments.

Thatā€™s just an excuse to learn something new :wink::nerd_face:

1 Like

Thank you for sharing this! I had to remove Karabiner on my new M1 Mac because it was causing a kernel panic on shutdown. Thought I had a faulty unit for awhileā€¦

Huh. I donā€™t think Iā€™m getting a KP on shutdown, but every time I restart my M1 MacBook Air, I get a message that ā€œYour computer was restarted because of a problemā€ so I wonder if that problem is Karabiner.

Did you try logging out before you shutdown? I wonder if thereā€™s a way to unload Karabiner on logout, if itā€™s not already done.

You are experiencing the same thing I am. When I try to shut down all looked fine except for a brief pink screen would flash and I got the error on startup. Hereā€™s the bug Iā€™m tracking on GitHub. Lots of other users have reported the same behavior. I did not try logging out, but removing Karabiner resolved the problem for me entirely.

So far over the past few days, if I log out before I reboot/shutdown, that does seem to fix the issue for me.

Obviously limited data and YMMV, but FYI / FWIW.

1 Like

Thatā€™s great news, might give it a try again. Itā€™s a Mac Mini so I donā€™t shut down often, feels like a simple step to add in between. :slight_smile:

Yep, that is the same exact thing I am experiencing, pink screen and all. Iā€™m just going to uninstall for now.

Another option that may be worth a closer look.

2021-01-19-17.54.55

2 Likes

Lol. I saw that the other day and immediately updated BTT to the alpha. It didnā€™t work with the directional keys at first. Emailed the dev. He fixed it immediately and it works great now.

Funny how that just dropped in my lap after making my OG post.

1 Like