Re: NSButton + optionkey?
Re: NSButton + optionkey?
- Subject: Re: NSButton + optionkey?
- From: glenn andreas <email@hidden>
- Date: Sat, 20 Aug 2005 09:20:02 -0500
On Aug 20, 2005, at 7:52 AM, Theodore H. Smith wrote:
How do I detect if the user is holding the optionkey down, while
clicking on an NSButton?
I tried this:
unsigned int f = [[NSApp currentEvent] modifierFlags];
BOOL optKeyDown = f & NSAlternateKeyMask;
return optKeyDown; //
that didn't work, though, it always returned false.
This does work correctly, but you're getting caught by C issues.
Consider this:
int f = 4 bytes (say, oh, 0x00080000)
NSAlternateKeyMask = 1 << 19;
typedef signed char BOOL;
Bitwise anding of "f & NSAlternateKeyMask" is 0x00080000.
Store that 4 byte value in a signed char - what do you get?
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden