1

I want to use XBOX360 controller to emulate user input in my Windows Phone 7 game ( created in XNA 4). But I am unable to read pad state - property GamePadState.IsConnectedis set to false, although my pad is connected and efficient. I thought that pad's input may be disabled by default, just like keyboard ones ( page up / break activate it), but I was unable to find right button / button combination.

My question: Is it possible to handle XBOX 360 pad input in windows phone 7 game ( XNA 4) ?

zgorawski
  • 2,597
  • 4
  • 30
  • 43

2 Answers2

3

You cannot use the Xbox 360 gamepad in the context of a Windows Phone 7 applications - for obvious reasons (you cannot connect it to a physical device later on).

Den
  • 16,686
  • 4
  • 47
  • 87
1

The GamePad class can be used to detect that the Back button is pressed on the phone:

if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
{
  // do something      
}

I don't believe that will detect the back button on the actual gamepad, just the button on the phone.

Dave Carlile
  • 7,347
  • 1
  • 20
  • 23