Gerriet,

Check out the function GetCurrentEventKeyModifiers() in the Carbon Event Manager reference:

<http://developer.apple.com/documentation/Carbon/Reference/Carbon_Event_Manager_Ref/Reference/reference.html#//apple_ref/doc/uid/TP30000135-DontLinkChapterID_1-DontLinkElementID_20 >

regards,

douglas

On Apr 3, 2008, at 4:44 AM, Gerriet M. Denkmann wrote:

Llistening at NSWindowDidUpdateNotification (or probably better: NSApplicationWillUpdateNotification) is certainly a good idea. Whenever the modifier keys change (and on several other occasions as well) an NSApplicationWillUpdateNotification gets send.

When I get such a notification I could, as you suggested, "make the appropriate modifications to your button based on the state of the keyboard."

But: how do I get this aforementioned state? [NSApp currentEvent] might be the key-event, but I am not sure I can rely on this. Maybe another event came after this and before the notification gets sent.

I would like to have something like [NSApp currentModifierFlags] (similar to [NSEvent modifierFlags])


Kind regards,

Gerriet.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to