Re: modifier-flags with no key pressed and mouseDown 256, why?
Re: modifier-flags with no key pressed and mouseDown 256, why?
- Subject: Re: modifier-flags with no key pressed and mouseDown 256, why?
- From: Shawn Erickson <email@hidden>
- Date: Fri, 16 Jan 2009 14:23:40 -0800
On Fri, Jan 16, 2009 at 1:08 PM, Alexander Reichstadt <email@hidden> 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;
This is a bit field so I personally prefer to work with it as such...
if ((modifierFlags & NSDeviceIndependentModifierFlagsMask)) == 0) {
// no standard modifier is pressed
} else {
// some standard modifier is pressed
}
-Shawn
_______________________________________________
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