Jump to content
  • Advertisement
Sign in to follow this  
Tertsi

Windows C++ Input Thread can't GetAsyncKeyState

This topic is 4445 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

I have a main thread which creates an input thread, which seems to be able to get the cursor pos just fine. But at least when the window has lost focus (it's hidden), only my main thread is able to successfully GetAsyncKeyState but I want the input thread to be able to GetAsyncKeyState instead. The main thread however processes the WM_ input messages. The only thing I really do after executing _beginthread(ProcessInputThreadStarter, 0, this); is CoInitialize(NULL); (In a Input thread's function.) before I try to GetAsyncKeyState. What else should I do or is there no way I can have the input thread GetAsyncKeyState when the focus to the window has been lost?

Share this post


Link to post
Share on other sites
Advertisement
As I understand it, only the thread which created the window can process input. So, I don't think you can do what you are trying to do.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!