8000 mac: fix keyUp while cmd pressed by gorsat · Pull Request #392 · emoon/rust_minifb · GitHub
[go: up one dir, main page]

Skip to content

mac: fix keyUp while cmd pressed - #392

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

emoon merged 1 commit into
emoon:masterfrom
gorsat:keyup-with-cmd

Conversation

@gorsat
@gorsat gorsat commented Nov 28, 2025
Copy link
Copy Markdown
Contributor

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
@emoon
emoon commented Dec 5, 2025
Copy link
Copy Markdown
Owner

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

0