Im using vb, and when i use the arrow keys when im using a different program other than my game the game thinks im telling it to move even tho i dont want it to. I know im doing osmething wrong but i dont know what. ;x
Decalres
'DirectX Stuff
'
Public dX As New DirectX7 'Direct X Object
Public DDRAW As DirectDraw7 'DirectDraw
Public DI As DirectInput 'Direct Input
Public DS As DirectSound
Public ColorKey As DDCOLORKEY
'Direct Input
Public DIKEYBOARD As DirectInputDevice
Public KeyState As DIKEYBOARDSTATE
Initialize
'Direct Input
'
Set DI = dX.DirectInputCreate()
Set DIKEYBOARD = DI.CreateDevice("GUID_SysKeyboard") 'Create a keyboard object off the Input object
DIKEYBOARD.SetCommonDataFormat DIFORMAT_KEYBOARD 'specify it as a normal keyboard, not mouse or joystick
DIKEYBOARD.SetCooperativeLevel frmHwnd, DISCL_BACKGROUND Or DISCL_NONEXCLUSIVE
DIKEYBOARD.Acquire 'aquire the keystates.
I hope this helps :/
[edited by - JoHnOnIzEr on August 8, 2003 11:05:47 PM]