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: booltrue 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, returnfalse. 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 consolesSee also
Overview of GameInputIGameInputDevice
GameInputDeviceEvent
IGameInput::RegisterDeviceCallback
