DirectInput and XUSB Devices
The driver for the Xbox 360 Common Controller class (XUSB) on Windows implements the kernel-mode interface for the XINPUT DLL. To provide a good experience for legacy titles that use the DirectInput API with the common controller device, the driver also exports a Human Interface Device (HID) class interface, which is picked up by DirectInput. We chose the mapping of XUSB to HID based on typical behavior in a set of gaming applications for the original XINPUT version, and we updated the mapping for newer subtypes. This topic describes the mapping.
Human Interface Device (HID)
HID standard is a standard from the Universal Serial Bus (USB) committee originally proposed by Microsoft to generalize protocols for input devices. It consists of a byte-code description language and can express gamepads, mice, joysticks, throttle and rudder controls, and multi-axis controllers. Because this standard is so generalized, you might have difficulty writing software that consumes input from arbitrary devices. Therefore, for the game-centric DirectInput API, we developed a specific sub-mapping of types to encourage hardware manufactures to support through their drivers.
Mappings
The XUSB driver implements both an XUSB class interface and a HID class interface for devices in order to support both XINPUT and DirectInput usage. This mapping is based on the XUSB subtype information. The driver implements four distinct groups of mappings.
| XUSB Subtype | Mapping |
|---|---|
| XINPUT_DEVSUBTYPE_GAMEPAD (Subtype 1) | Gamepad |
| XINPUT_DEVSUBTYPE_DANCE_PAD (Subtype 5) | Default for any new subtype |
| XINPUT_DEVSUBTYPE_GUITAR (Subtype 6) | |
| XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE (Subtype 7) | |
| XINPUT_DEVSUBTYPE_DRUM_KIT (Subtype 8) | |
| XINPUT_DEVSUBTYPE_GUITAR_BASS (Subtype 11) | |
| XINPUT_DEVSUBTYPE_ARCADE_STICK (Subtype 3) | Arcade Stick/Arcade Pad |
| XINPUT_DEVSUBTYPE_ARCADE_PAD (Subtype 19) | |
| XINPUT_DEVSUBTYPE_WHEEL (Subtype 2) | Wheel |
| XINPUT_DEVSUBTYPE_FLIGHT_STICK (Subtype 4) | Flight Stick |
Gamepad
This is the default mapping and is designed around the standard Xbox 360 Common Controller gamepad, and is exposed as a Gamepad usage type.
| Control | DirectInput HID Mapping |
|---|---|
| Left Stick | X, Y |
| Right Stick | Rx, Ry |
| Left Trigger + Right Trigger | Z* |
| D-Pad Up, Down, Left, Right | Hat Switch |
| A | Button1 |
| B | Button 2 |
| X | Button 3 |
| Y | Button 4 |
| LB (left bumper) | Button 5 |
| RB (right bumper) | Button 6 |
| BACK | Button 7 |
| START | Button 8 |
| LSB (left stick button) | Button 9 |
| RSB (right stick button) | Button 10 |
Arcade Stick/Arcade Pad
This is the mapping designed around the Arcade Stick controller, and is exposed as a Gamepad usage type. The Arcade Pad is very much like an Arcade Stick, but in a smaller form-factor. These designs replace the analog Left Trigger and Right Trigger with digital buttons that report the minimum and maximum axis value.
| Control | DirectInput HID Mapping |
|---|---|
| D-Pad Up, Down, Left, Right | Hat Switch |
| A | Button1 |
| B | Button 2 |
| X | Button 3 |
| Y | Button 4 |
| LB (left bumper) | Button 5 |
| RB (right bumper) | Button 6 |
| BACK | Button 7 |
| START | Button 8 |
| Left Trigger | Button 9 |
| Right Trigger | Button 10 |
These devices may or may not support additional controls, but these are not exposed by the HID mapping: Left Stick, Right Stick, LSB (left stick button), and RSB (right stick button).
Wheel
This mapping is designed around the Xbox 360 Racing Wheel, and is exposed as a Gamepad usage type.
| Control | DirectInput HID Mapping |
|---|---|
| Wheel (Left Stick X) | X |
| Accelerator Pedal (Right Trigger) + Brake Pedal (Left Trigger) | Z* |
| D-Pad Up, Down, Left, Right | Hat Switch |
| A | Button1 |
| B | Button 2 |
| X | Button 3 |
| Y | Button 4 |
| LB (left bumper) | Button 5 |
| RB (right bumper) | Button 6 |
| LSB (left stick button) | Button 7 |
| RSB (right stick button) | Button 8 |
| BACK | Button 9 |
| START | Button 10 |
Flight Stick
This mapping is designed around the Xbox 360 Flight Stick, and is exposed as a Joystick usage type.
| Control | DirectInput HID Mapping |
|---|---|
| Flight Stick (Left Stick) | X, Y |
| POV Hat (Right Stick) | Rx, Ry |
| Throttle (Right Trigger) | Z |
| Rudder (Left Trigger) | Rz |
| D-Pad Up, Down, Left, Right | Hat Switch |
| Primary Weapon (A) | Button1 |
| Secondary Weapon (B) | Button 2 |
| X | Button 3 |
| Y | Button 4 |
| LB (left bumper) | Button 5 |
| RB (right bumper) | Button 6 |
| BACK | Button 7 |
| START | Button 8 |
| LSB (left stick button) | Button 9 |
| RSB (right stick button) | Button 10 |