Hammerspoon: Mission control related shortcuts do not work on macOS Mojave

Created on 26 Sep 2018  路  7Comments  路  Source: Hammerspoon/hammerspoon

After updating to macOS Mojave (10.14), I could no longer get hammerspoon to execute key-binds that access mission control
hs.eventtap.keyStroke({"ctrl"}, "up")
or switch desktops
hs.eventtap.keyStroke({"ctrl"}, "left")
hs.eventtap.keyStroke({"ctrl"}, "right")

These commands worked fine in Yosemite, Sierra and High Sierra.

Most helpful comment

Try adding "fn" as a modifier. hs.eventtap.keyStroke({"fn", "cmd"},"left",100) works where hs.eventtap.keyStroke({"cmd"},"left",100) doesn't.

All 7 comments

Not working here either. Doh! Any ideas @cmsj or @asmagill ?

I got this same error both on Keyboard Maestro and Hammerspoon, use applescript fix temporarily:

hs.osascript.applescript("tell application \"System Events\" to key code 123 using control down")

Nice workaround @Voleking !

FYI: I tried all the steps listed here with Hammerspoon, but none of them seemed to work sadly.

I also tried giving Hammerspoon "Full Disk Access", but no luck.

Possibly related? https://stackoverflow.com/a/52386903/6925202

I wonder if the only solution is to re-write hs.eventtap - as I know this is something @asmagill has talked about for a while (#1161)?

Hyper's window summon extension doesn't like this, either. I set Hyper to react to F18, which has stopped working after switching to Mojave. This is my Hammerspoon line:

hs.eventtap.keyStroke({}, 'F18')

Haven't had the issue. Does adding a 0 delay fix?

      hs.eventtap.keyStroke({"ctrl"},dir,0)

Try adding "fn" as a modifier. hs.eventtap.keyStroke({"fn", "cmd"},"left",100) works where hs.eventtap.keyStroke({"cmd"},"left",100) doesn't.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomrbowden picture tomrbowden  路  3Comments

Pancia picture Pancia  路  4Comments

latenitefilms picture latenitefilms  路  3Comments

luckman212 picture luckman212  路  4Comments

reestr picture reestr  路  3Comments