Olá,
de acordo com o post do forum abaixo, nem sempre o Windows faz um scan das teclas, então GetKeyState força este scan.
Cita:
|
❞
I'v been using GetAsyncKeyState quite extensively without any issues. But if you follow the news groups, you'll realize that GetKeyboardState does have a quirk which is really not identified in the MS docs. The quirk is that the message processing can go out of synch based on how the messages are processed. In other words, Windows can sometimes avoid updating the keystate buffer if for some unknown reason it feels that updating the buffer is not necessary at times. Thus, the key state buffer may not be up to date and in sych with the input message queue. The news group folks recommend calling GetKeyState prior to calling GetKeyboardState to eliminate this potential problem.
|
GetKeyboardState() problem
Saludos, Emerson