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

# GetControllerSwitchState

> IGameInputReading::GetControllerSwitchState

Retrieves the switch state from a game controller.

## Syntax

```cpp theme={null}
uint32_t GetControllerSwitchState(
    uint32_t stateArrayCount,
    GameInputSwitchPosition* stateArray
);
```

### Parameters

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

The expected number of switches on the game controller.
This value can be retrieved by calling [IGameInputReading::GetControllerSwitchCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.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

- [GetControllerSwitchCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.md)
- [GameInputSwitchPosition](https://docs.xbox.com/reference/input/gameinput/enums/gameinputswitchposition.md)
- [IGameInputReading (Interface contents)](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)
- [GetControllerAxisState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)
- [GetControllerButtonState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttonstate.md)
