> ## 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.

# GetControllerButtonState

> IGameInputReading::GetControllerButtonState

Retrieves button state information from a game controller.

## Syntax

```cpp theme={null}
uint32_t GetControllerButtonState(
    uint32_t stateArrayCount,
    bool* stateArray
);
```

### Parameters

*stateArrayCount*   \_In\_\
Type: uint32\_t

Expected count of buttons on a game controller.
This number can be retrieved by calling [IGameInputReading::GetControllerButtonCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttoncount.md)

[Input API Overview](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

- [GetControllerButtonCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttoncount.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)
- [GetControllerAxisState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)
- [GetControllerSwitchState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchstate.md)
