11

Wondering if anyone can help out with this doozy.

I've got an NSMenu hosted by an NSStatusItem in the system status bar.

For various reasons, I'd like to over-ride the default keydown behavior of the NSMenu, which is called "type-select". Essentially, when the menu is active, you press a key and the menu highlights an item with a matching leading character in the title.

I want to disable this behavior & define some of my own.

The problem? There is no hook for the keyDown event in NSMenuDelegate. Subclassing NSMenu is a no go because it doesn't inherit from NSResponder anyways. So nothing there either.

Looking at NSMenu, NSMenuDelegate, NSMenuItem, there is no clearly documented evidence of what NSResponder is actually handling keyDown events that drive the default "type-select" behavior.

Any insights would be very much appreciated. And I would be happy to clarify my question if it doesn't make sense yet.

Thanks!

Alec Sloman
  • 699
  • 4
  • 18

0 Answers0