hs.hotkey.modal broken after updating to MacOS 15.3.1?

35 views
Skip to first unread message

Mark Fulbright

unread,
Mar 12, 2025, 12:57:36 PMMar 12
to Hammerspoon
Hi all,

I updated my Mac this morning, and to my dismay it seems that my Hammerspoon hotkey is not working correctly anymore.

After some debugging, it seems that hotkey modals simply do not register keybindings for any single-character keys, e.g. "R", "J", "0", etc. If you register a binding for a single-character key, Hammerspoon will run as if you'd never attempted to bind to that key at all. Even using raw keycodes for the letters rather than single-character strings doesn't work. E.g. running `k:bind('', 74, ...)` rather than `k:bind('', 'J', ...)` still doesn't work.

Interestingly, binding to keys like "Space", "Right", and "Escape" does still work. So it really seems to just be something about single-character keys.

As a simple demonstration of this, even the sample code given on the hs.hotkey.modal docs page fails to work:
k = hs.hotkey.modal.new('cmd-shift', 'd')
function k:entered() hs.alert'Entered mode' end
function k:exited()  hs.alert'Exited mode'  end
k:bind('', 'escape', function() k:exit() end)
k:bind('', 'J', 'Pressed J',function() print'let the record show that J was pressed' end)

The "escape" binding works, but the "J" binding does not.

Does anyone know what might be causing this, or how to fix it?

Thanks very much,
Mark


Mark Fulbright

unread,
Mar 12, 2025, 1:47:32 PMMar 12
to Hammerspoon
Well, now it seems to be working again. Probably just user error. Sorry to bother everyone.

-Mark

M N

unread,
Mar 17, 2025, 7:11:17 PMMar 17
to Hammerspoon

Did you change anything after the error? Maybe you assigned some permissions in the settings or restarted the device?

Mark Fulbright

unread,
Mar 18, 2025, 4:55:06 PMMar 18
to M N, Hammerspoon
Embarrassingly, I believe there was an unrelated modal dialog that had popped up on my screen and was absorbing certain key events, preventing Hammerspoon from receiving the keystrokes that it should have been. I'm not certain this was the problem, but I think immediately after closing the model, my Hammerspoon bindings started working without any problem again.

--
You received this message because you are subscribed to a topic in the Google Groups "Hammerspoon" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hammerspoon/GKMD4VUlLvA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hammerspoon...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/hammerspoon/8ccce9b0-f22f-4e6e-bf48-b449f0de8354n%40googlegroups.com.


--

Mark Fulbright
Reply all
Reply to author
Forward
0 new messages