• Advertisement
Sign in to follow this  

GetKeyState from within a DLL

This topic is 3994 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement