> ## 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::GetRacingWheelInfo

> 检索设备的赛车方向盘属性，例如其控件标签、踏板、换挡器和最大方向盘角度。

检索设备的赛车方向盘属性，例如其控件标签、踏板、换挡器和最大方向盘角度。

## 语法

```cpp theme={null}
bool GetRacingWheelInfo(
    GameInputRacingWheelInfo* info
);
```

### 参数

*info*   \_Out\_\
类型：[GameInputRacingWheelInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/structs/gameinputracingwheelinfo.md)\*

指向 `GameInputRacingWheelInfo` 结构的指针，该结构接收设备的赛车方向盘属性。如果设备不支持赛车方向盘输入，则该结构的每个成员都设置为零。

### 返回值

类型：bool

如果设备支持赛车方向盘输入并且已填充 *info*，则为 `true`；否则为 `false`。

## 备注

`GetRacingWheelInfo` 方法将设备的赛车方向盘属性复制到调用方提供的结构中。当 [GetSupportedInput](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) 返回的值包含 `GameInputKindRacingWheel` 时，设备支持赛车方向盘输入。如果设备不支持赛车方向盘输入，`GetRacingWheelInfo` 会将 *info* 零初始化并返回 `false`。

`hasClutch`、`hasHandbrake` 和 `hasPatternShifter` 成员报告存在哪些可选控件，`minPatternShifterGear` 和 `maxPatternShifterGear` 给出排挡式换挡器的挡位范围，`maxWheelAngle` 给出方向盘的最大旋转角度。各标签成员以 [GameInputLabel](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputlabel.md) 值的形式描述印在相应控件上的标记，以便你在 UI 中显示匹配的提示。`extraButtonCount` 和 `extraAxisCount` 成员报告设备在标准赛车方向盘映射之外还具有多少个控制器按钮和轴；使用 [GetExtraButtonIndexes](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttonindexes.md) 和 [GetExtraAxisIndexes](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxisindexes.md) 在读数的控制器状态中找到它们。赛车方向盘状态通过 [IGameInputReading::GetRacingWheelState](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getracingwheelstate.md) 从读数中读取。

此方法返回的属性在设备的生存期内是固定的，因此你可以只查询一次（例如在设备连接时）并缓存结果。

以下示例演示如何查询设备的赛车方向盘属性。

```cpp theme={null}
GameInputRacingWheelInfo info;
if (device->GetRacingWheelInfo(&info))
{
    if (info.hasClutch)
    {
        // Enable manual clutch controls.
    }
}
```

在 GameInput v3 及更早版本中，此信息可从 [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) 返回的 [GameInputDeviceInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 结构的 `racingWheelInfo` 成员中获取。

## 要求

**头文件：** GameInput.h

**库：** gameinput.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[GameInput 概述](https://docs.xbox.com/zh-CN/build/core-features/common/input/overviews/input-overview.md)\
[GameInputRacingWheelInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/structs/gameinputracingwheelinfo.md)\
[GetSupportedInput](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)\
[GameInputKind](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputkind.md)\
[GameInputLabel](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputlabel.md)\
[IGameInputReading::GetRacingWheelState](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getracingwheelstate.md)\
[IGameInputDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 版本历史

| 版本 | 变更 |
| - | - |
| **v4** | 引入。 |


## Related topics

- [GameInputRacingWheelInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/structs/gameinputracingwheelinfo.md)
- [IGameInputDevice::GetMouseInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getmouseinfo.md)
- [IGameInputDevice::GetInputReportInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportinfo.md)
- [IGameInputDevice::GetKeyboardInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getkeyboardinfo.md)
- [IGameInputDevice::GetGamepadInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getgamepadinfo.md)
