Re: Reading Modifier Keys Down during Launch - still needs "Carbon"?
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