Skip to main content
Retrieves the labels of the generic controller buttons on the device.

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 is nullptr 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 call GetControllerButtonLabels 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.
In GameInput v3 and earlier, this information was available from the 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 consoles

See also

Overview of GameInput
GetControllerButtonCount
GameInputLabel
IGameInputReading::GetControllerButtonState
IGameInputDevice

Version History

Last modified on November 5, 2026