Re: GetAsyncKeyState(VK_LBUTTON) true after DoModal()
Which OS is this on. I tried this on XP and GetAsyncKeyState said that the
key was down.
"Goran" <email@example.com> wrote in message
On Apr 6, 8:13 pm, Joseph M. Newcomer <newco...@flounder.com> wrote:
Perhaps because you had to click the OK button? And the mouse button is
still down? You
are essentially seeing the result of the difference between computer speed
speed; within a few tens to a small integer number of hundreds of
microseconds after you
have clicked the button, the mouse button state is examined, and according
instantaneous state, the mouse button is still down, because the message
that it has come
up has not yet been processed. I find the basic idea of this test more
than a little
weird, actually. Why would you care if the mouse button was down a few
the DoModal() returns?
No, there really is something fishy (I tried yesterday).
You have to __release__ the mouse button for the UI button to fire
"clicked" event (I am guessing, I didn't trace through that, I just
called DoModal()). That's normal behavior. So when I release my mouse
button, UI button should fire "clicked" and mouse button it should
exactly be released. But GetAsyncKeyState says it isn't! Amazing!
Why?! How!? I have no explanation.
Looks like a question for MS people.
Is the left button really down?
Is there something else I could do to check if the left button is down.
Please explain why you think this is important.
That, I would like to know why, too. Just out of curiosity, might
learn about some use-case I never met in the wild.