[SlimdX]directinput problem
hi i am trying to create a directinput device but i can´t, i have found this thread in the:http://www.gamedev.net/community/forums/topic.asp?topic_id=495706 forum but i doesn´t work for me.
Here is my code:
Private keyb As SlimDX.DirectInput.Device
Private Sub InitializeInputDevices()
Dim keyboardDevice As New SlimDX.DirectInput.DeviceClass(Of keyboarsdtate)(SystemGuid.Keyboard)
keyb.SetCooperativeLevel(Me, DirectInput.CooperativeLevel.Background Or DirectInput.CooperativeLevel.Nonexclusive)
keyb.Acquire()
End Sub
but i have two errors :
keyboardstate is not defined
SlimDX.DirectInput.DeviceClass' hasn´t parameters of type and because of that can´t have arguments of type
What version do you have? last is feb 2010. You can initialize the keyboard like this:
C# code..
C# code..
SlimDX.DirectInput.Mouse mouse;SlimDX.DirectInput.Keyboard keyboard;SlimDX.DirectInput.DirectInput directInput;public void IniKeyBoard(){ //....stuff load this.directInput = new SlimDX.DirectInput.DirectInput(); this.keyboard = new SlimDX.DirectInput.Keyboard(this.directInput); this.mouse = new SlimDX.DirectInput.Mouse(this.directInput);}public void Update(){ if (!this.keyboard.Acquire().IsSuccess || !this.mouse.Acquire().IsSuccess) return; SlimDX.DirectInput.KeyboardState key = this.keyboard.GetCurrentState(); SlimDX.DirectInput.MouseState mouse = this.mouse.GetCurrentState(); if (key.IsPressed(SlimDX.DirectInput.Key.W)) //do stuff}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement