Re: Toggle an object (image) when Command key is pressed: flagsChanged?
Re: Toggle an object (image) when Command key is pressed: flagsChanged?
- Subject: Re: Toggle an object (image) when Command key is pressed: flagsChanged?
- From: Kyle Sluder <email@hidden>
- Date: Tue, 26 Jul 2011 14:11:35 -0700
On Tue, Jul 26, 2011 at 12:50 PM, Patrick Robertson
<email@hidden> wrote:
> First, you can see from the code that I can't seem to find a mask for when
> 'no' modifier keys are pressed. This method does get called for key downs
> and key ups. It seems 'no keys' corresponds to 0x100, but is there no
> constant I can use?
Did you remember to AND the modifierFlags with
NSDeviceIndependentModifierFlagsMask?
>
> Secondly, this method seems to get called when other key combos are pressed
> (e.g. ⌘S or ⌘Q). This means the object/image will flick back/forward, which
> isn't entirely desirable.
In either 10.5 or 10.6, Apple changed the implementation of NSToolbar
to avoid this flickering by delaying for a fraction of a second before
changing its image in response to a -flagsChanged: event. Check the
AppKit release notes for more info.
--Kyle Sluder
_______________________________________________
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