Topic: https://brettterpstra.com/2016/09/29/a-better-hyper-key-hack-for-sierra/
hide preview

What's next? verify your email address for reply notifications!

node was disabled (waiting for deletion)

(waiting for deletion)

hide preview

What's next? verify your email address for reply notifications!

Chris L 8y, 118d ago

My primary use of the HyperKey is to trigger Keyboard Maestro macros (and conflict palettes). I'm confused as to whether any of these solutions will allow me to continue doing that with Sierra?

remark link
hide preview

What's next? verify your email address for reply notifications!

ttscoff 8y, 118d ago

Yes, the combination of Karabiner-Elements (which thankfully is working again after a complete fail on the last macOS dev update) and Hammerspoon will allow you to send the same triggers you have set up for KM.

hide preview

What's next? verify your email address for reply notifications!

Brayden McLean 8y, 141d ago

I've added my own hammerspoon config file, that add nested loops over the cursor directions. Also works for Colemak: https://github.com/braydenm...

hide preview

What's next? verify your email address for reply notifications!

Tore 8y, 161d ago

I made a few minor changes to Brett's init.lua to make it work for me as I was used to. Change the keysiusewithhyper array to your own list of keys that you use with Hyper/Capslock. This is my complete init.lua file:


-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")

-- Trigger existing hyper key shortcuts
keysiusewithhyper = {'left', 'right', 'up', 'down', '1', '2', '3', 'a', 's', 'd', 'w', 'x', 'd'}
for i,v in ipairs(keysiusewithhyper) do
k:bind({}, v, nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, v); k.triggered = true end)
end

-- Enter Hyper Mode when F18 (Hyper/Capslock) is pressed
pressedF18 = function()
k.triggered = false
k:enter()
end

-- Leave Hyper Mode when F18 (Hyper/Capslock) is pressed,
-- send ESCAPE if no other keys are pressed.
releasedF18 = function()
k:exit()
if not k.triggered then
hs.eventtap.keyStroke({}, 'ESCAPE')
end
end

-- Bind the Hyper key
f18 = hs.hotkey.bind({}, 'F18', pressedF18, releasedF18)

with the existing karabiner.json file:


{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"caps_lock": "f18"
}
}
]
}
hide preview

What's next? verify your email address for reply notifications!

Tore 8y, 161d ago

I made a small change to Brett's init.lua to make it work for me as I was used to. Change the keysiusewithhyper array to your own list of keys that you use with Hyper/Capslock. This is my complete init.lua file:


-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")

-- Trigger existing hyper key shortcuts
keysiusewithhyper = {'left', 'right', 'up', 'down', '1', '2', '3', 'a', 's', 'd', 'w', 'x', 'd'}
for i,v in ipairs(keysiusewithhyper) do
k:bind({}, v, nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, v) end)
end

-- Enter Hyper Mode when F18 (Hyper/Capslock) is pressed
pressedF18 = function()
k.triggered = false
k:enter()
end

-- Leave Hyper Mode when F18 (Hyper/Capslock) is pressed,
-- send ESCAPE if no other keys are pressed.
releasedF18 = function()
k:exit()
if not k.triggered then
hs.eventtap.keyStroke({}, 'ESCAPE')
end
end

-- Bind the Hyper key
f18 = hs.hotkey.bind({}, 'F18', pressedF18, releasedF18)

with the existing karabiner.json file:


{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"caps_lock": "f18"
}
}
]
}


hide preview

What's next? verify your email address for reply notifications!

Aymon Fournier 8y, 164d ago

Wait, I followed the instructions, and the previous tutorial, pre-Sierra, and this isn't working. Does this not give you the Hyperkey that in any "Set Your Shortcut Window" system-wise, would emulate pressing ctrl+alt+shift+command? I installed the software and placed the files in their respective folders, and nothing is happening.

remark link
hide preview

What's next? verify your email address for reply notifications!

ttscoff 8y, 164d ago

You have to generate the shortcuts directly. See https://gist.github.com/tts...

hide preview

What's next? verify your email address for reply notifications!

Aymon Fournier 8y, 164d ago
hide preview

What's next? verify your email address for reply notifications!

Behinder 8y, 166d ago

This is a bit madness...why to bind something to f18 and do all the macros to the same key? I thought whole purpose was to modify behaviour of Caps Lock. I am on MacBook and have no f18 key so..is it not easier to have hyper binded to capslock?

hide preview

What's next? verify your email address for reply notifications!

Alesh Houdek 8y, 166d ago

This is madness. I am holding off upgrading to Sierra over this.

hide preview

What's next? verify your email address for reply notifications!

Ilia Vakili 8y, 170d ago

So you've bound the vim style movements to the control key? Weren't you able to use the hyper key instead? I tried to bind them to no avail.

hide preview

What's next? verify your email address for reply notifications!

Kennon 8y, 170d ago

Anyone have this working on the 10.12.1 beta of Sierra? Wondering if it's me doing something wrong, or the beta. I feel like everything is set based on the tutorial from Matt Perry + here, but Caps Lock fails to actually do anything.

remark link
hide preview

What's next? verify your email address for reply notifications!

Blake Dietz 8y, 146d ago

It's working for me after a system restart on 10.12.1 (non beta).

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Kennon 8y, 145d ago

I found this PR to work well for me. I've been using it. It doesn't work super well with the ESC toggle functionality, but I mostly wanted to have the CTRL+CMD+SHIFT+OPT support.

https://github.com/tekezo/K...

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Blake Dietz 8y, 145d ago

I'm using a fork of Brett's configurations for keyboard maestro integration.

https://github.com/blakedie...

hide preview

What's next? verify your email address for reply notifications!

TG Lee 8y, 170d ago

Instead of "escape", I would like to retain the "caps lock" functionality when the key is released. Any help, please?

hide preview

What's next? verify your email address for reply notifications!

Joey Baker 8y, 170d ago

Thanks so much for your tips. I've got a problem though: I've duplicated the setup above, but my escape key only triggers on every-other keypress. Does anyone have this issue? Any advice?

remark link
hide preview

What's next? verify your email address for reply notifications!

ArleyM 8y, 167d ago

Also had the issue! It was madness.

hide preview

What's next? verify your email address for reply notifications!

v 8y, 171d ago

Does this simulate ctrl+alt+shift+command? I've did the above but my current shortcuts are not working.

remark link
hide preview

What's next? verify your email address for reply notifications!

curtjester 8y, 171d ago

You have to setup each key combinations separately,

In Brett's config he has the example of:

k:bind({}, 'm', nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, 'm') end)

Which would setup one hyperkey for the m key

remark link parent
hide preview

What's next? verify your email address for reply notifications!

V 8y, 171d ago

Wow thank you, I was going crazy trying to figure it out. Much appreciated!

hide preview

What's next? verify your email address for reply notifications!

curtjester 8y, 171d ago

👍 Thanks so much for this.

hide preview

What's next? verify your email address for reply notifications!

Clark Goble 8y, 171d ago

Any word on whether Karabiner and Seil are getting ported? Last I heard the developer was working on it but it was more involved than it appears. If those start working I'd rather stick with those. (I'm actually holding off upgrading my main machine because of this)

remark link
hide preview

What's next? verify your email address for reply notifications!

curtjester 8y, 171d ago

Karabiner-Elements is going to be the way forward for macOS Sierra. Right now no multi-key binding.

Still using Karabiner-Elements with Hammerspoon does work and I was able to use what Brett pointed to get my Hyperkey back along with the escape functionality.

hide preview

What's next? verify your email address for reply notifications!