Capture key press events while NSMenu is open
Asked Answered
D

1

8

I'm interested in capturing key presses while a NSMenu is open. For example, if the menu is open and the user presses "e", or "1" on the keyboard, send a particular message (preferably passing an event object which contains reference to which key was pressed).

I've looked into alternate menus, but I'm under the impression that can only be used to capture the option key.

Currently I'm not using any custom views, just NSStatusBar (where the menu spawns from) and NSMenu.

I'm new to Objective-C so my apologies if I'm wording anything incorrectly.

Really appreciate the help!

Dramatization answered 22/9, 2010 at 22:11 Comment(0)
Y
-3

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

Yeargain answered 23/9, 2010 at 11:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.