• 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
Re: Getting the state of the option key...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the state of the option key...


  • Subject: Re: Getting the state of the option key...
  • From: Mel Walker <email@hidden>
  • Date: Thu, 29 Aug 2002 17:33:11 -0600

On Thursday, August 29, 2002, at 04:35 PM, Scott Ryder wrote:

At Application launch I need to check to see if the option key was
held down by the user. I would think this is simple enough but am
unable to find anything in the Docs as to how to get the state of a key
or what messages to listen for. I am hoping I don't have to go to
Carbon to do this.

I'm afraid your hope is in vain. :-( Try this:

BOOL optKeyDown = ((GetCurrentKeyModifiers() & (optionKey | rightOptionKey)) != 0) ? YES : NO;

Of course, you'll have to #import <Carbon/Carbon.h> or something more specific.

I was disappointed myself on this very topic.

--
Mel Walker <email@hidden>
Software Engineer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Getting the state of the option key...
  • Next by Date: Re: Tracking files the right way
  • Previous by thread: Re: Getting the state of the option key...
  • Next by thread: Reading NSTask output
  • Index(es):
    • Date
    • Thread