• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSButton + optionkey?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSButton + optionkey?


  • Subject: NSButton + optionkey?
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Sat, 20 Aug 2005 13:52:34 +0100

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.

I tried this within a NSButton subclass:


- (void)mouseUp:(NSEvent*)theEvent { unsigned int f = [theEvent modifierFlags]; BOOL optKeyDown = f & NSAlternateKeyMask; ... }

But optKeyDown was always false, again.

How is this done then? Do I need to go outside of Cocoa and use CarbonLib calls?

--
http://elfdata.com/plugin/

What does our work achieve, if it's not making the world a happier place?
http://www.whatnextjournal.co.uk/Pages/Next/Happiness.html
When's the last time you thought deeply about how to improve our lives?



_______________________________________________ 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
  • Follow-Ups:
    • Re: NSButton + optionkey?
      • From: glenn andreas <email@hidden>
  • Prev by Date: Notification for Changed User Defaults
  • Next by Date: Re: Notification for Changed User Defaults
  • Previous by thread: Re: Notification for Changed User Defaults
  • Next by thread: Re: NSButton + optionkey?
  • Index(es):
    • Date
    • Thread