mono/MonoGame — pull request #1483 by Aranda (2013-03-01 10:31:10+00:00)
Title: Improvements for Ouya GamePad

Adds support for disconnecting and reconnecting gamepads including the GamePadState.IsConnected property. Reconnected gamepads get the same player number that they previously had. The Ouya team are likely to fix this issue in a future release, but until then it'd be nice to have it working.

Also added GamePad.GetState() override taking GamePadDeadZone.

To test, add this to the Draw() of a default Ouya project.

```
spriteBatch.Begin();
float y = 15;
for (int i = 0; i < 4; ++i)
{
GamePadState gs = GamePad.GetState((PlayerIndex)i, GamePadDeadZone.Circular);
string textToDraw = string.Format(
"Pad: {0} Connected: {1} LS: ({2:F2}, {3:F2}) RS: ({4:F2}, {5:F2}) LT: {6:F2} RT: {7:F2}",
i, gs.IsConnected,
gs.ThumbSticks.Left.X, gs.ThumbSticks.Left.Y,
gs.ThumbSticks.Right.X, gs.ThumbSticks.Right.Y,
gs.Triggers.Left, gs.Triggers.Right);

spriteBatch.DrawString(font, textToDraw, new Vector2(16, y), Color.White);
y += 25;
}
spriteBatch.End();
```