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

# IGameInputDevice::GetControllerAxisCount

> デバイス上の汎用コントローラー軸の数を取得します。

デバイス上の汎用コントローラー軸の数を取得します。

## 構文

```cpp theme={null}
uint32_t GetControllerAxisCount();
```

### パラメーター

このメソッドにはパラメーターがありません。

### 戻り値

型: uint32\_t

デバイス上のコントローラー軸の数。デバイスにコントローラー軸がない場合は 0。

## 解説

コントローラー軸は、デバイスのマッピングされていない生の軸です。[GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) から返される値に `GameInputKindControllerAxis` が含まれている場合、そのデバイスにはコントローラー軸があります。`GameInputKindControllerAxis` を含むデバイスからの読み取りは、[IGameInputReading::GetControllerAxisCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxiscount.md) を通じて同じ数の軸を報告します。

返された値を使用して、[GetControllerAxisLabels](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxislabels.md) または [IGameInputReading::GetControllerAxisState](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md) に渡す配列のサイズを決定します。デバイスが接続されている間、軸の数は変化しません。

GameInput v3 以前では、この情報は [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) から返される [GameInputDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 構造体の `controllerInfo` メンバーが参照する [GameInputControllerInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputcontrollerinfo.md) 構造体の `controllerAxisCount` メンバーから取得できました。

## 要件

**ヘッダー:** GameInput.h

**ライブラリ:** gameinput.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体、XBOX Series 本体

## 関連項目

[GameInput の概要](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-overview.md)\
[GetControllerAxisLabels](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxislabels.md)\
[IGameInputReading::GetControllerAxisCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxiscount.md)\
[IGameInputReading::GetControllerAxisState](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)\
[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## バージョン履歴

| バージョン | 変更内容 |
| - | - |
| **v4** | 導入されました。 |


## Related topics

- [GameInputControllerInfo (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputcontrollerinfo.md)
- [IGameInputDevice::GetControllerAxisLabels](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxislabels.md)
- [GetControllerAxisCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxiscount.md)
- [IGameInputDevice::GetControllerButtonCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttoncount.md)
- [IGameInputDevice::GetControllerSwitchCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerswitchcount.md)
