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

# GetExtraAxisIndexes

> GetExtraAxisIndexes

# GetExtraAxisIndexes

Gets the controller axis indexes of the extra axes on the device for a given input kind.

## Syntax

```cpp theme={null}
HRESULT GetExtraAxisIndexes(
    GameInputKind inputKind,
    uint32_t extraAxisCount,
    uint8_t* extraAxisIndexes
);
```

### Parameters

*inputKind*   \_In\_\
Type: GameInputKind

The input kind whose extra axis indexes are being requested.

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

Expected count of axis indexes for extra axes.
This number can be retrieved by calling  [GetExtraAxisCount](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxiscount).

*extraAxisIndexes*   \_Out\_writes\_(extraAxisCount)\_\
Type: uint8\_t\*

Pointer to the array of axis indexes.

### Return value

Type: HRESULT

Function result.

## Remarks

The `GetExtraAxisIndexes` method retrieves the controller axis indexes of the extra axes that are present on the device for a given input kind. Extra axes are controller axes that exist on the physical device but are not part of the standard mapping for the specified input kind.

Before calling this method, you should first call [GetExtraAxisCount](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxiscount) to determine how many extra axes are available and pass that count as the extraAxisCount parameter.

The following code example demonstrates how to make use of a gamepad's extra axes:

```cpp theme={null}
bool GetGamepadExtraAxisValues(
    std::vector<float>* extraAxes,
    IGameInputReading* reading) noexcept
{
    Mwrl::ComPtr<IGameInputDevice> device;
    reading->GetDevice(&device);

    uint32_t extraAxisCount = 0;
    if (FAILED(device->GetExtraAxisCount(GameInputKindGamepad, &extraAxisCount)))
    {
        return false;
    }

    std::vector<uint8_t> axisIndexes(extraAxisCount);
    extraAxes->resize(extraAxisCount);
    if (FAILED(device->GetExtraAxisIndexes(
        GameInputKindGamepad,
        extraAxisCount,
        axisIndexes.data())))
    {
        return false;
    }

    std::vector<float> axisStates(reading->GetControllerAxisCount());
    reading->GetControllerAxisState(static_cast<uint32_t>(axisStates.size()), axisStates.data());

    for (size_t i = 0; i < axisIndexes.size(); ++i)
    {
        if (axisIndexes[i] < axisStates.size())
        {
            (*extraAxes)[i] = axisStates[axisIndexes[i]];
        }
    }

    return true;
}
```

## Requirements

**Header:** GameInput.h

**Library:** gameinput.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[GameInputKind](/reference/input/gameinput/enums/gameinputkind)<br />
[GetExtraAxisCount](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxiscount)<br />
[GetExtraButtonIndexes](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttonindexes)<br />
[IGameInputDevice](/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice)

## Version History

| Version | Changes     |
| ------- | ----------- |
| **v3**  | Introduced. |


## Related topics

- [GetExtraAxisCount](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxiscount.md)
- [GetExtraButtonIndexes](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttonindexes.md)
- [IGameInputDevice](/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [GetExtraButtonCount](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttoncount.md)
- [GameInputAxisMapping](/reference/input/gameinput/structs/gameinputaxismapping.md)
