   Directx Input Key Press
  I would like ask that how can I simulate "key press" using directx?What I mean "key press" is that it just counts once if the button is pressed without releasing.Should I save the previous keystate in order to implement it?Any better solution? THX   
  You don't need DirectX for this. In fact, Microsoft recommends that you don't use DirectX for this. Regular old WM_KEYDOWN and WM_KEYUP will suffice.A key press is defined as a WM_KEYDOWN without a WM_KEYUP. You can implement key press detection however you want. A buffer of key states isn't a bad approach.   ;  Having a buffer of previous states is usual how it's done. The problem with only using the default windows message pump is you can't handle more than one key input at a time. There are also other ways to check a keystate without DInput, like the winapi funcs GetKeyState, GetAsyncKeyState, GetKeyboardState, etc. But either way you'd need to setup a buffer to remember the previous keystate for the most reliable performance... it would just be an unsigned char[256] array.[Edited by - Foofles on June 2, 2010 8:35:57 AM]