> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetControllerButtonCount

> IGameInputReading::GetControllerButtonCount

Retrieves the number of buttons on a game controller.

## Syntax

```cpp theme={null}
uint32_t GetControllerButtonCount();
```

### Parameters

This method has no parameters.

### Return value

Type: uint32\_t

Returns the number of buttons on the game controller.

## Remarks

The `IGameInputReading::GetControllerButtonCount` method retrieves the number of buttons for a game controller. It also determines the buffers required by the [IGameInputReading::GetControllerButtonState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttonstate.md) method.

For intermediate and advanced use-cases of the GameInput API, see [Advanced GameInput topics](https://docs.xbox.com/build/core-features/common/input/advanced/input-advanced-topics.md).

## Requirements

**Header:** GameInput.h

[Overview of GameInput](https://docs.xbox.com/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputReading](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)

## Version History

| Version | Changes |
| - | - |
| **v0** | Introduced. |


## Related topics

- [GetControllerButtonState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttonstate.md)
- [IGameInputReading (Interface contents)](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)
- [Interfacing with the different GameInput device types](https://docs.xbox.com/build/core-features/common/input/hardware/input-hardware-interfaces.md)
- [GetExtraButtonCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttoncount.md)
- [GetControllerSwitchCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.md)
