Skip to main content
Gets the XInput user index that’s assigned to the input device, if any.

Syntax

Parameters

index   _Out_
Type: uint32_t*
Receives the zero-based XInput user index (0 through 3) of the device. If the device doesn’t have an XInput user index, this is set to 0.

Return value

Type: bool true if the device currently has an XInput user index; otherwise, false.

Remarks

The XInput user index is the controller slot that the XInput API uses to identify a controller, which typically corresponds to the player indicator shown on the controller. Use this method to correlate a GameInput device with the controller that the same user index refers to in XInput, for example when migrating a title from XInput to GameInput one controller at a time. Only devices that are exposed through XInput have a user index. Other devices, such as keyboards, mice, and most HID game controllers, return false. Aggregate devices never have an XInput user index. When a device disconnects, its user index is released, and the method returns false. Unlike most device properties, the XInput user index can change while the device is connected. When it changes, GameInput notifies registered device callbacks with the GameInputDeviceEventXInputIndexUpdated value of GameInputDeviceEvent. Call GetXInputDeviceIndex again from the callback to get the new index.

Requirements

Header: GameInput.h Library: gameinput.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

Overview of GameInput
IGameInputDevice
GameInputDeviceEvent
IGameInput::RegisterDeviceCallback

Version History

Last modified on November 5, 2026