Hi Rob,

    > Actually, the reply I considered writing to Martin's
    > suggestion had nothing to do with other processes.
    > I was going to point out that GetAsyncKeyState is
    > asynchronous. It gets the state of the key _right
    > now_, at the time the function is called. What you're
    > probably more interested in is the state of the key at
    > the time the focus-control message was sent. That's
    > GetKeyState.

Yes I know. But the electronics in the keyboard decoder has
to debounce the switch contact. Typically that involves a 20ms
delay. You would have to be working on a very old and slow
computer for the key to have been released, and *detected*
released by the decoder, before the control loses focus.

In practice I use GetAsyncKeyState for keyboard control of
my app, and I've never yet found a situation on a variety of
systems with and without all sorts of other processes running
where the app fails to respond to the users intention because
of key timing issues.

regards,

Martin.

Reply via email to