• 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: Detecting modifier key down when opening a menu?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting modifier key down when opening a menu?


  • Subject: Re: Detecting modifier key down when opening a menu?
  • From: Laurent Daudelin <email@hidden>
  • Date: Tue, 18 May 2010 11:35:37 -0700

On May 18, 2010, at 10:59, Nick Zitzmann wrote:

>
> On May 18, 2010, at 11:38 AM, Laurent Daudelin wrote:
>
>> What's the best way to detect if a modifier key is held down when the user click to open a menu?
>
> [[NSApp currentEvent] modifierFlags] ought to work...
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>

Thanks, Nick. That works. But now I realize I would need something a little more dynamic. I see that NSResponder has "flagsChanged:" when a modifier flag changes but since NSMenu is not a subclass of NSResponder, I'm not sure how to detect this once the menu is pulled down. Should I subclass my main window to detect it?

-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 				http://nemesys.dyndns.org
Logiciels Nemesys Software              				email@hidden
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

_______________________________________________

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: Detecting modifier key down when opening a menu?
      • From: Eric Schlegel <email@hidden>
References: 
 >Detecting modifier key down when opening a menu? (From: Laurent Daudelin <email@hidden>)
 >Re: Detecting modifier key down when opening a menu? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: (solved?) baseURL problem with +fileURLWithPath:
  • Next by Date: Re: Detecting modifier key down when opening a menu?
  • Previous by thread: Re: Detecting modifier key down when opening a menu?
  • Next by thread: Re: Detecting modifier key down when opening a menu?
  • Index(es):
    • Date
    • Thread