Re: Getting the current state of the modifier keys
Re: Getting the current state of the modifier keys
- Subject: Re: Getting the current state of the modifier keys
- From: Eric Schlegel <email@hidden>
- Date: Sat, 22 Feb 2003 22:45:08 -0800
On Saturday, February 22, 2003, at 04:33 PM, Jeffrey Mattox wrote:
But, if I'm not the active application, then the flags returned are
wrong.
Note this comment in CarbonEventsCore.h:
/*
* GetCurrentEventKeyModifiers()
*
* Note that GetCurrentEventKeyModifiers only returns a valid
* modifier state if your application is the active application. If
* your application is not active, then user input events are not
* flowing through the event dispatcher and the queue-synchronized
* state is not updated.
Is there a reliable way to get the current state of the modifier keys,
even when I'm not active?
GetCurrentKeyModifiers in HIToolbox/Events.h will return the current
hardware state of the key modifiers. I seem to recall that you
originally said something about posting an option key press using
SystemEvents, though; I'm not sure if GetCurrentKeyModifiers will work
in that case, when you're creating a "software key press" rather than
affecting the actual hardware state. You'll have to try and see.
-eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.