Sign in to follow this  

Windows C++ Input Thread can't GetAsyncKeyState

Recommended Posts

Tertsi    123
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this