I suppose it depends on what you want to do, but probably not.
GetKeyboardState only gets the current state, and with a hook you get all the keystrokes as they arrive.
I’m not sure that you can even interrogate it fast enough so that you don’t miss a single keystroke, but even if you did it if, for example, you pressed the A key during one poll and the A key still had the state pressed during next polling time, as you might say, whether it was one long or two quick keystrokes.
source
share