Skip to main content
Gets the number of generic controller buttons on the device.

Syntax

Parameters

This method has no parameters.

Return value

Type: uint32_t The number of controller buttons on the device, or 0 if the device has no controller buttons.

Remarks

Controller buttons are the raw, unmapped buttons of a device. A device has controller buttons when the value returned by GetSupportedInput includes GameInputKindControllerButton. Readings from the device that include GameInputKindControllerButton report the same number of buttons through IGameInputReading::GetControllerButtonCount. Use the returned value to size the array that you pass to GetControllerButtonLabels or to IGameInputReading::GetControllerButtonState. The number of buttons doesn’t change while the device is connected. In GameInput v3 and earlier, this information was available from the controllerButtonCount 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
GetControllerButtonLabels
IGameInputReading::GetControllerButtonCount
IGameInputReading::GetControllerButtonState
IGameInputDevice

Version History

Last modified on November 5, 2026