On Fri, Jan 16, 2009 at 4:08 PM, Alexander Reichstadt <l...@mac.com> wrote: > Hi, > > I have a phenomenon I am exploiting but unless I know for sure why it works > must stop to use. The objective is to make sure that while the mousebuttons > is being pressed no other modifier key is pressed, if anything is pressed > the whole method return. Testing for 256 seems to work, why? > > NSUInteger modifierFlags = [currentEvent modifierFlags]; > if (modifierFlags!=256) return; > > Is there some documentation that supports this test, or do I have to check > for all the different keys not to be pressed instead?
Yes, there is documentation that supports it, the description of the -modifierFlags method: "The lower 16 bits of the modifier flags are reserved for device-dependent bits." In other words, the bottom 16 bits can be anything at any time. Mask them out for this test. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com