   Get previous key
  I'm using-> VC++ 2008 and DirectX 9 SDK <-I've been struggling with it for quiet a while now and i just can't figure out how to get the previous key stroke.here is what i want to do~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#game logic... (done)#check the previous key for some logicget key press (done)store new key press as previous key press~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~My main problem is that I cant figure out how to store the key press data...do u know a better way for getting previous key press? Please not the win32 keyboard method, only DX.(i wanna learn, not use old stuff, even if im not gonna use it as much)Thank you in advance,NetwatcherEdit:maybe what i'm looking for is how to store the DIK_//somekey value[Edited by - Netwatcher on May 2, 2009 3:13:13 PM]
  I hate to break it to you, but by using DirectInput you ARE using old stuff.  It's completely outdated for keyboard and mouse input, and there's absolutely no reason to use it for these things.  In fact the only good reason left to use DI is for legacy gamepad/joystick support.  If you really need low-level access to keyboard and mouse input then the Raw Input API's are easier to use and more efficient.  If you just need more basic stuff or if you want proper keyboard/mouse pre-processing for GUI stuff, then Win32 messages are the way to go.Anyway...you could just store your old key values in an array of bools, and use the keycode to index into the array.   ;  Don't use DirectInput for keyboard input - even Microsoft recommend you don't.Just capture input from the Win32 messages [smile]Edit: Ninja'd   ;  Got it!  dinput bad , win32 good :P and i meant new for me!(sry for the confusion)I'm a newb... not hard to tell Thanks guys!I ended up using some bools as flags, and did use the DX thingy just cos it was easier and already set-up, that also means i need to make a new bool type for every key i want to do this for (in this case only one so it doesn't really matters)Gonna note what you said for future projects though.and... mhum... which method does XNA use? win32 or DX?Cheers,Netwatcher~~~~~~~~~~~~~~~~~~~~~~~~~I tried XNA and it's amazing (how easy everything is in C#...), the only problem is the high graphics req... damnit old laptopstill think i can do so much more in C/Cpp, maybe not now but you wait...[Edited by - Netwatcher on May 3, 2009 11:55:14 PM]