Skip to content

mac: fix keyUp while cmd pressed#392

Merged
emoon merged 1 commit intoemoon:masterfrom
gorsat:keyup-with-cmd
Dec 5, 2025
Merged

mac: fix keyUp while cmd pressed#392
emoon merged 1 commit intoemoon:masterfrom
gorsat:keyup-with-cmd

Conversation

@gorsat
Copy link
Contributor

@gorsat gorsat commented Nov 28, 2025

Problem: keyUp events were not being sent (to InputCallback) on mac while the command key was pressed.

I tried messing with acceptsFirstResponder, adding different views, etc. but I couldn't get macOS to send these events.
But addLocalMonitorForEventsMatchingMask:NSEventMaskKeyUp seems to work consistently. This is an application-wide hook, though, so the code has to filter the events to ensure each window only handles those meant for it. It's slightly inefficient in that each window registers its own monitor, but I couldn't see an obvious way to avoid that.

Caution: I know next to nothing about macOS programming. Multiple LLMs helped me figure this out.

@emoon emoon merged commit 5d49132 into emoon:master Dec 5, 2025
4 checks passed
@emoon
Copy link
Owner

emoon commented Dec 5, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants