Original Post
First of all, I''d like to say I''m using C++. In the book I''m reading, a sample uses the GetAsyncKeyState() function to check the user''s keyboard input. I''m a bit confused, as I''m used to seeing a check for WM_KEYDOWN in the message loop. In the samples of the book, the author checks for a message in the message loop, if he gets one he sends it to the wndProc() function, and if no message is found, the code calls a function that does everthing that would be normally processed while the program is idle. In this particular sample, in the "idle" function, called display() (the book is based on DirectX), has the function GetAsyncKeyState() checking for the A and S keys. I''m not an advanced windows programmer, so I don''t completely know what it is. My question is: what is the difference between using GetAsyncKeyState() as compared to the message loop for checking for a key that the user presses down?
Joshua Merchant