Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
GameInput mouse and keyboard devices are separately defined in the API and covered elsewhere as these devices have special meaning in Windows. See Developing keyboard and mouse HID client drivers for more information.
GameInput represents a wide variety of devices, including controllers, gamepads, flight sticks, arcade sticks, racing wheels, and UI navigation controllers. Each device type has its own interface that you can use to interact with the device. Whether a hardware device shows up under one of these interfaces depends on whether the device conforms to one of the existing Windows driver protocols for gaming input controllers, or is a generic HID device.
For XInput-compatible devices, the GameInput API enumerates these devices as a controller, a gamepad and a UI navigation controller. The mapping of these devices is strictly dictated by the protocol, and no extra buttons are supported at this time. These devices also support dual or quad rumble effects. These correspond to the left and right motors, and the left and right triggers. There are three main wire protocols for XInput: XUSB, XInputHID and the Game Input Protocol (GIP). On console, only GIP devices are supported. More information on all of these protocols can be found in the XInput API Documentation for Hardware Devices. Note that on PC it is preferred for devices to interface with the XInputHID driver. For other Game Input Protocol (GIP) devices apart from gamepads, the GameInput API enumerates these devices as a flight stick, arcade stick, racing wheel, or UI navigation controller based on the metadata it presents at connection. This is true for both console and PC. More information can be found in the Game Input Protocol (GIP) documentation.
For HID devices, GameInput provides a lot of flexibility in how devices present themselves to the operating system. This means that HID devices can potentially expose a wide range of features and capabilities beyond what is defined by the standard game controller protocols. A racing wheel device for example could potentially present itself to GameInput as a gamepad and flight stick. The full list of buttons, switches and axes available on the device is defined by the device's HID report descriptor and exposed through IGameInputReading interface from the GetControllerButtonState, GetControllerButtonCount and the homologous calls to get axis or switches. To map these into other interfaces such as gamepad or racing wheel, GameInput leverages a series of mappings in the Windows registry. These mappings are shared with the Windows.Gaming.Input (WGI) API. More information can be found in the Registry Data for Game Controllers page. IHVs can add their registry mappings to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GameInput\Devices path as part of their driver installation. The GameInput API will periodically add default mappings for common devices with future releases of the API which will be redistributed with games. IHV mappings take precedence over the default mappings.
See also
Game Input Protocol (GIP) / XInputHID driver documentation (download)