Reading Modifier Keys Down during Launch - still needs "Carbon"?
Reading Modifier Keys Down during Launch - still needs "Carbon"?
- Subject: Reading Modifier Keys Down during Launch - still needs "Carbon"?
- From: Jerry Krinock <email@hidden>
- Date: Tue, 2 Feb 2010 06:51:27 -0800
In Mac OS 10.6, during -applicationDidFinishLaunching, [NSEvent currentEvent] returns nil, so the usual code,
[[NSEvent currentEvent] modifierFlags]
is not useful for determining if a modifier key was held down during launch. (By accident, I've noticed that I do get an event with correct modifierFlags if I send the message after a performSelector:withObject:afterDelay:.05. But I'd rather not do that.)
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?
Thanks,
Jerry Krinock_______________________________________________
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