GetKeyState from within a DLL
Why doesn't GetKeyState() work from a DLL?
I am trying to develop a platform where AI-DLLs (not developed by myself) would control specific game elements (a tank specifically). I want to make a game tutorial AI that just delegates user input to the game.
From the MSDN:
Quote:An application calls GetKeyState in response to a keyboard-input message. This function retrieves the state of the key when the input message was generated.Are you doing that, or are you just calling it randomly? If you're just calling it randomly, then you should be using GetAsyncKeyState() instead. I suspect there's some randomness going on with window messages and different modules...
Quote:Original post by Evil Steve
From the MSDN:Quote:An application calls GetKeyState in response to a keyboard-input message. This function retrieves the state of the key when the input message was generated.Are you doing that, or are you just calling it randomly? If you're just calling it randomly, then you should be using GetAsyncKeyState() instead. I suspect there's some randomness going on with window messages and different modules...
Ow I see.. Will try GetAsyncKeyState() instead tomorrow on my own computer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement