I needed "GetKeyState", which I think is not currently defined in
User32.
Here's the code I offer for addition to some future version (I hope
this helps):
/**
* @param vKey
* Specifies one of 256 possible virtual-key codes.
* @return
* If the high-order bit is 1, then the key is down; otherwise, it
* is up. If the low-order bit is 1, then the key is toggled.
* "Toggled" applies to keys like CAPS LOCK and NUMLOCK that can
* be toggled on and off by a key press.
*/
short GetKeyState(int vKey);
I looked a little to see if there was a way I could include a unit
test, although I dunno how one would really do that. I suppose I
could have written one that called the new method, then asserted that
I didn't crash. In any case, I only did some interactive testing.
Cheers,
--Bob
On Dec 14, 2011, at 5:10 PM, Bob Whiteside wrote:
You might want to use GetAsyncKeyState rather than GetKeyState; not sure what sorts of things might plug up the input handling queue.
T.