Input Reporter

This utility reports all GamePad state and capability data available via the XNA Framework.

Overview

The GamePad type provided by the XNA Framework provides an API to poll the state and capabilities of compliant devices that are connected to the computer or Xbox 360, supporting up to four concurrent controller connections. All compliant accessories, such as the Xbox 360 Wireless Racing Wheel, fill the same GamePadState and GamePadCapabilities structures as the Xbox 360 Controller.

This utility displays this data for all controllers connected to the system. The display updates as controllers are used, connected, and disconnected. The Ring of Light graphic at the top-right corner of the screen shows which controllers are connected. The numerals around the Ring of Light indicate which controller is currently being displayed. The active controller is switched by pressing any of the digital buttons on the controller you wish to switch to. The labels and GamePadType data provided match the method and enumeration names provided by the XNA Framework for easy correlation. Values that are not supported, according to the GamePadCapabilities structure, are dimmed.

Since all of the GamePadState values are displayed as data, it would have been frustrating to map any of them directly to an action, such as the BACK button immediately exiting the application. Input Reporter implements a "charging switch" that triggers an action after a button is held down for several seconds, allowing the user to test the controllers without immediately controlling the application.

A common use of this utility is to investigate how the controls provided by various accessories map to the GamePadState and GamePadCapabilities values.

Minimum Shader Profile

Vertex Shader Model 1.1
Pixel Shader Model 1.1

Sample Controls

This sample uses the following keyboard and gamepad controls.

Action Keyboard Control Gamepad Control
Switch the active controller. n/a Any digital button (A, B, X, Y, Left Shoulder Button, Right Shoulder Button, Left Thumbstick, Right Thumbstick, START, or BACK)
Toggle the dead zone. SPACEBAR Hold START for three seconds.
Exit the sample. ESC or ALT+F4 Hold BACK for three seconds.

Extending the Utility

  • Add additional charging switches to initiate a vibration test, on one or both of the motors.
  • Add keyboard and mouse data reporting and make it an all-around input reporter.