DirectInput GetExtendedState not detecting any button presses

Jul 27, 2012 at 1:33 AM


This gets my button count fine, the axes are also reported back, however no matter what buttons I actually press on the joypad, it always shows the status as Released for every button!

Other programs work with my joypad fine, emulators, Joy2Key.. etc..

I am using this ( with the PS2 pad fuction. It uses buttons 1 to 16.

Sep 28, 2012 at 10:01 PM
Edited Sep 29, 2012 at 6:06 AM

I'm having the same issue. Gamepads are detected but don't respond.

Does this little code snippet look ok?


   if (input.GetGamePad(ExtendedPlayerIndex.Five).GetState().DPad.Down == ButtonState.Pressed)
                this.Cam.Move(new Vector2(0, 8));

I notice in the debugger, there is a private property on the GamePad currentlyAcquired which is false.
Is that significant?
I realised, I needed to call input.Update(). That changes currentlyAcquired to true but unfortunately I'm still not getting any response.


---edit: Sorry it seems to have been a problem with the button config on my weird chinese gamepads. After adding the input.Update() I get stick movement, and I'm sure I can figure out the buttons from here.

Nov 7, 2012 at 1:18 AM
Edited Nov 7, 2012 at 1:26 AM

I'm also having the same problem.

My program correctly identifies the number of buttons; the only problem is that it does not detect button presses at all.

#edit: Putting input.Update() did not seem to help at all.

#edit2: I was being an idiot and using ExtendedPlayerIndex.One on a non-Xbox controller. Update solved the problem.

Thanks, codeimpy for the solution !