Trigger key events when NSMenu is open

I am interested in taking keystrokes while NSMenu is open. For example, if the menu is open and the user presses "e" or "1" on the keyboard, send a specific message (preferably passing an event object containing a link to the key by pressing the key).

I looked at alternative menus, but I have the impression that it can only be used to capture the option key.

I am not currently using any custom views, just NSStatusBar (where the menu is called) and NSMenu .

I am new to Objective-C, so I apologize if I have phrased something wrong.

Really appreciate the help!

+6
objective-c cocoa nsmenu nsevent
source share
1 answer

I assume you are looking for this: Cocoa NSStatusBar Global HotKey

-one
source share

All Articles