• 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: Reading Modifier Keys Down during Launch - still needs "Carbon"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading Modifier Keys Down during Launch - still needs "Carbon"?


  • Subject: Re: Reading Modifier Keys Down during Launch - still needs "Carbon"?
  • From: Eric Schlegel <email@hidden>
  • Date: Tue, 02 Feb 2010 08:42:48 -0800

On Feb 2, 2010, at 6:51 AM, Jerry Krinock wrote:

> Searching the list archives, from 8 years ago I find the solution is to instead #import <Carbon/Carbon.h> and use GetCurrentEventKeyModifiers().
>
> It works, and although there is copious documentation in the header and in the Carbon Event Manager Programming Guide, searching current Xcode documentation for this function gives "No Results", and since this function returns a UInt32, I wonder if it will be supported in current and future 64-bit builds?

Yes, it will be until we decide to break compatibility with 64-bit Cocoa applications, but in addition to the CG option already mentioned, in 10.6 there's also a modifierFlags class method on NSEvent, so this works:

NSUInteger flags = [NSEvent modifierFlags];

-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

References: 
 >Reading Modifier Keys Down during Launch - still needs "Carbon"? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Opening dual NSStreams synchronously
  • Next by Date: Re: NSTableView questions (take 2)
  • Previous by thread: Re: Reading Modifier Keys Down during Launch - still needs "Carbon"?
  • Next by thread: Re: NSProgressIndicator Stuck after unhiding + other triggers. Demo App.
  • Index(es):
    • Date
    • Thread