What is the difference between GetKeyState () and GetAsyncKeyState ()?

0

I have always used GetKeyState() to know if the user is pressing a key, but I see that many people use GetAsyncKeyState() more. With this I got the following doubts:

  • What's the difference between the 2?

  • When should I use each?

  • In an application that should be the best and fastest possible, which one should I use?

  • asked by anonymous 15.08.2017 / 22:32

    1 answer

    0

    Apparently it has to do with the return of the method, at documentation there is a specific explanation: " The key status returned from this function changes as a thread reads key messages from its message queue. The status does not reflect the interrupt-level state associated with the hardware. Use the GetAsyncKeyState function to retrieve that information. "

    Knowing which one to use depends on the result you want to get, as the methods return different information.

        
    20.10.2017 / 19:12