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

# IGameInputReading::GetControllerSwitchState

> IGameInputReading::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](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount).

[Input API Overview](/build/core-features/common/input/overviews/input-overview)\
[IGameInputReading](/reference/input/gameinput/interfaces/igameinputreading/igameinputreading)

## Version History

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


## Related topics

- [IGameInputReading::GetControllerSwitchCount](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.md)
- [GameInputSwitchPosition](/reference/input/gameinput/enums/gameinputswitchposition.md)
- [IGameInputReading::GetControllerAxisState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)
- [IGameInputReading::GetControllerButtonState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttonstate.md)
- [IGameInputReading::GetControllerButtonCount](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttoncount.md)
