Re: Detecting modifier key down when opening a menu?
Re: Detecting modifier key down when opening a menu?
- Subject: Re: Detecting modifier key down when opening a menu?
- From: Dave DeLong <email@hidden>
- Date: Tue, 18 May 2010 13:10:38 -0600
Sounds to me like you want to investigate NSMenuItem's setAlternate: method.
I answered a StackOverflow question about this recently, so I'll just link to that post instead of typing everything again. :)
http://stackoverflow.com/questions/2808016#2808168
Cheers,
Dave
On May 18, 2010, at 1:05 PM, Laurent Daudelin wrote:
> On May 18, 2010, at 11:57, Eric Schlegel wrote:
>
>>
>> On May 18, 2010, at 11:35 AM, Laurent Daudelin wrote:
>>
>>> 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?
>>
>> Once the menu is pulled down, the Menu Manager is running a nested event loop to track user input, so no NSEvents will be sent during that time anyways.
>>
>> Can you tell us what exactly you're trying to accomplish?
>>
>> -eric
>
> Well, I'd like to track the option key down when a menu is opened so that I can change one of the menu item title dynamically.
>
> -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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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