Syntax
Parameters
labelArrayCount   _In_Type: uint32_t Number of elements in labelArray. To retrieve all controller button labels, pass the value returned by GetControllerButtonCount. labelArray   _Out_writes_to_opt_(labelArrayCount, return)
Type: GameInputLabel* Pointer to an array that receives one label per controller button. Can be
nullptr, in which case nothing is written and the method returns 0.
Return value
Type: uint32_t The number of elements written to labelArray. This is the smaller of labelArrayCount and the number of controller button labels on the device, or 0 if labelArray isnullptr or the device has no controller button labels.
Remarks
Each element is a GameInputLabel value that identifies the marking printed on the corresponding button, if the device reports one. Call GetControllerButtonCount to get the number of controller button labels, allocate an array of that size, and then callGetControllerButtonLabels to fill it. If labelArrayCount is smaller than the number of controller button labels, only the first labelArrayCount elements are written. The controller button labels of a device don’t change while the device is connected, so you can query them once and cache the result.
Element i of the label array describes the button at index i of the array returned by IGameInputReading::GetControllerButtonState for readings from this device.
The following example shows how to retrieve the controller button labels of a device.
controllerButtonLabels member of the GameInputControllerInfo structure, which was referenced by the controllerInfo member of the GameInputDeviceInfo structure returned by IGameInputDevice::GetDeviceInfo.
Requirements
Header: GameInput.h Library: gameinput.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consolesSee also
Overview of GameInputGetControllerButtonCount
GameInputLabel
IGameInputReading::GetControllerButtonState
IGameInputDevice
