In Mac OS X 10.6, NSEvent has a +modifierFlags class method to determind the currently pressed modifier flags. In 10.5, using [[NSApp currentEvent] modifierFlags] only updates after mouse move. Is there any way to asynchronously get the modifier flags?
In Mac OS X 10.6, NSEvent has a +modifierFlags class method to determind the
Share
According to a comment on this blog post, you can use CGEventCreate() and CGEventGetFlags().
The modifier flags returned by CGEventGetFlags() (CGEventFlags) are the same as the NSEvent ones.