   win32 Check if two keys pressed(W,D)
  I am working on a sprite based game, and am trying to say in my WM_KEYDOWN for my window procedure function, to check if two different keys are pressed so that that I can move my sprite north east, south east, south west, or north west.So keys W and D = north eastkeys D and S = south eastkeys A and S = south westkeys A and W = north westThanks =)   
  typically you have a bool array of 256 size where in the windows code you havecase WM_KEYDOWN:{keys[wParam] = TRUE;return 0;}case WM_KEYUP:{keys[wParam] = FALSE;return 0;}that way, all you need to do is sayif (keys[VK_W] && keys[VK_Q])   ;This is what I have right now. What you just said doesn't really go along with this, can you elaborate a little bit? Thankscase WM_KEYDOWN:{switch(wParam){case 0x57: //W{app->MoveToon(TOON_NORTH);break;}case 0x53: //S{app->MoveToon(TOON_SOUTH);break;}case 0x41: //A{app->MoveToon(TOON_WEST);break;}case 0x44: //D{app->MoveToon(TOON_EAST);break;}default:{return 0;}}break;};Quote:for my window procedure function, to check if two different keys are pressed ..You can't do that in your window procedure. The keystrokes don't happen at the same time.Actually, you could do that in your window procedure, but you'd have to incorporate your entire logic sequence for each key combination into the procedure.You're combining two different aspects of your game into one function - getting user input, and calculating the animation. Those should be separate functions.You'll either have to make the movements one at a time, or implement something similar to what Argo15 suggests to capture keystrokes, wait for a short period of time between updates and then check if a combination of keys are down before you decide on the movement.   ;  You can also just call GetAsyncKeyState to detect outside of the WndProc if a key is down.   