This project is read-only.

InputState, does the DPad work?

Mar 21, 2009 at 1:38 PM
while programming a menu system for my project, I've encountered some problems in reading the state of the XBox360 gamepad DPad. 
"IsDown" and "OnPressed" always remains false on all DPad Buttons.

The other buttons and sticks work.

Plugging out the gamepad and trying the code with the keyboard works. The arrow keys get mapped correctly.

// class extending from Application
        protected override void Update(UpdateState state)
            InputState input = state.PlayerInput[PlayerIndex.One].InputState;

            if (input.Buttons.DpadDown.OnPressed)

//InitializePlayerInput is not overridden

 -> nothing happens when i press down on the gamepad.
the rest works as intended.

Did I forget anything? Can someone verify this or is it just me? 
I'm using the latest version (1.5.2)
Mar 22, 2009 at 1:22 PM
This certainly worked when I originally built the input code - although it's some of the oldest code and worst designed in the entire project. So it's quite possible something has broken and slipped through.
Unfortunately, due to circumstances beyond my control, I'm out of town and will not have access to a gamepad till the end of the week.

It's possible it's using the Keyboard to Input mapping, and the 'DPad' will be being mapped to the arrow keys. This should only happen when a game pad isn't connected though (checked during startup).

Mar 22, 2009 at 1:57 PM
thank you. Most people use the thumbsticks anyway, so it's more of a curiosity than a real problem ;)

Just for clarity, while the gamepad is connected the keyboard does not work. Which is of course the correct behaviour, but somewhat excludes a mapping problem (at least on that level).

Mar 23, 2009 at 3:22 AM

Ok. Sounds like there is a bug there. I can't test it right now, but I'll take a look when I get back.


Apr 15, 2009 at 6:56 AM
Sorry this literally took me three weeks to respond to. This got lost in my rush, as I've been moving out of town, etc.
Anyway. Short answer, you were right, and I fixed the bug but forgot to tell you how. In any case, the fix is the update I just put up.

Apr 17, 2009 at 4:07 PM
Thank you :)

We're all gratefull for your efforts put into this project. If Microsoft ever decides to let us publish from my country, the Xen API will get a nice, big, prominent place in our game's credits. (if you don't mind of course...[putting your logo in the credits would actually be against your license {I will just ask you when time comes.. }]) 
Apr 17, 2009 at 10:43 PM
No problem.
The wording of the license is important, it says 'it does not grant you' [the right to use my name / logo]. However this doesn't mean it restricts you. So if I give you permission to use my name / logo in your credits, then there is no problem. And yes, I'll be happy to do this when the time comes.