• 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: How get key down on launch?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How get key down on launch?


  • Subject: Re: How get key down on launch?
  • From: Eric Schlegel <email@hidden>
  • Date: Thu, 8 Nov 2007 21:33:23 -0800


On Nov 8, 2007, at 9:29 PM, Ken Drycksback wrote:

If the key in question is one of the modifier keys, you may be able to do something like this:

if (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0)
  {
  // option-key down
  }

Unfortunately it's not working. And I'd prefer not to use the old event manager functions since I assume they are not supported under 64 bit.

Using [NSApp currentEvent] at launch won't work because there is no current event at that point - you haven't started running the event loop yet.


GetKeys actually is available in 64-bit HIToolbox, specifically because there didn't appear to be any other way to do this, so I think it's your best option for now.

-eric

_______________________________________________

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


  • Follow-Ups:
    • Re: How get key down on launch?
      • From: Ken Drycksback <email@hidden>
References: 
 >How get key down on launch? (From: Ken Drycksback <email@hidden>)
 >Re: How get key down on launch? (From: Ricky Sharp <email@hidden>)
 >Re: How get key down on launch? (From: Ken Drycksback <email@hidden>)

  • Prev by Date: Re: How get key down on launch?
  • Next by Date: Re: How get key down on launch?
  • Previous by thread: Re: How get key down on launch?
  • Next by thread: Re: How get key down on launch?
  • Index(es):
    • Date
    • Thread