开发者

Capture key press events while NSMenu is open

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 keyboa开发者_StackOverflow中文版rd, 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!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜