• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Capturing key events in a menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Capturing key events in a menu


  • Subject: Re: Capturing key events in a menu
  • From: Benjamin Stiglitz <email@hidden>
  • Date: Mon, 18 May 2009 15:14:17 -0400
  • Mail-followup-to: Adam Warski <email@hidden>, email@hidden

> Basically, I want to do quite a simple thing: capture a "keyDown" event
> when a menu is opened. So the user opens a menu, presses a key and I want
> to know what key it was.
> Unfortunately NSMenu isn't an NSResponder, so I can't capture it there.
> Also, the event isn't passed down to NSApp (where I could capture it in a
> subclass or delegate), as the menu handles it to position the higlight on
> the appropriate letter. Can I somehow override that behaviour?

When a menu is open the Menu Manager in HIToolbox handles incoming
events on its own. You be able to capture the events with an embedded
NSView, but I first need to ask the standard question: waht are you
trying to achieve?

-Ben
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Capturing key events in a menu
      • From: Adam Warski <email@hidden>
    • Re: Capturing key events in a menu
      • From: "I. Savant" <email@hidden>
References: 
 >Capturing key events in a menu (From: Adam Warski <email@hidden>)

  • Prev by Date: How to set multiple values placeholder for NSPopupButton selectedTag binding?
  • Next by Date: Programatically set file URL of Core Data Document?
  • Previous by thread: Capturing key events in a menu
  • Next by thread: Re: Capturing key events in a menu
  • Index(es):
    • Date
    • Thread