Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observe NSMenu #134

Merged
merged 4 commits into from Jul 9, 2023
Merged

Observe NSMenu #134

merged 4 commits into from Jul 9, 2023

Conversation

decodism
Copy link
Contributor

@decodism decodism commented Jul 5, 2023

Fixes #129

Also adds partial support for macOS 14. Menus have been rewritten and a local event monitor receives keyUp but not keyDown.

@sindresorhus
Copy link
Owner

Also adds partial support for macOS 14. Menus have been rewritten and a local event monitor receives keyUp but not keyDown.

Opened an issue: #135

@sindresorhus sindresorhus merged commit f0d470d into sindresorhus:main Jul 9, 2023
1 check passed
@sindresorhus
Copy link
Owner

Seems to be working well. Thank you :)

@sindresorhus
Copy link
Owner

I have heard that this still works for observing key events in NSMenu on macOS 14:

let menuObserver = CFRunLoopObserverCreateWithHandler(nil, CFRunLoopActivity.beforeSources.rawValue, true, 0, { (observer, activity)
in
if let event = NSApp.currentEvent { ••• }
})
CFRunLoopAddObserver(CFRunLoopGetCurrent(), menuObserver, CFRunLoopMode.commonModes)

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.

Drop the isMenuOpen property?
2 participants