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

# GetControllerAxisState

> IGameInputReading::GetControllerAxisState

Retrieve axis state information from a game controller.

## Syntax

```cpp theme={null}
uint32_t GetControllerAxisState(
    uint32_t stateArrayCount,
    float* stateArray
);
```

### Parameters

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

The expected number of state arrays to capture the axes on a game controller.
This number can be retrieved from [IGameInputReading::GetControllerAxisCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxiscount.md)

*stateArray*   \_Out\_writes\_(stateArrayCount)
Type: float\*

Pointer to the arrays which contain the axis state data.

### Return value

Type: uint32\_t

Returns the number of valid buffer entries.

## Remarks

Most analog controls on a game controller (joysticks, triggers, sliders, dials, etc.) are surfaced as axes, which are floating-point values linearly normalized to the range \[0.0, 1.0]. Most digital inputs are surfaced as buttons, which are simple Boolean values. Hat switches are surfaced as switch values, and their position is represented by one of the [GameInputSwitchPosition](https://docs.xbox.com/reference/input/gameinput/enums/gameinputswitchposition.md) enumeration values.

## Requirements

**Header:** GameInput.h

[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

- [IGameInputReading (Interface contents)](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)
- [GetControllerAxisCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxiscount.md)
- [GetControllerButtonState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttonstate.md)
- [GetControllerSwitchState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchstate.md)
- [GetExtraAxisIndexes](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxisindexes.md)
