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

> 获取设备上力反馈马达的数量。

获取设备上力反馈马达的数量。

## 语法

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

### 参数

此方法没有参数。

### 返回值

类型：uint32\_t

设备上力反馈马达的数量；如果设备不支持力反馈，则为 0。

## 备注

力反馈马达通过从零开始的马达索引来寻址，该索引必须小于 `GetForceFeedbackMotorCount` 返回的值。将马达索引传递给 [CreateForceFeedbackEffect](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md)、[IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md) 和 [SetForceFeedbackMotorGain](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)。使用 [GetForceFeedbackMotorInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorinfo.md) 可了解每个马达支持哪些轴和效果类型。在设备保持连接期间，马达的数量不会更改。

在 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) 结构的 `forceFeedbackMotorCount` 成员中获取。

## 要求

**头文件：** 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)\
[GetForceFeedbackMotorInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorinfo.md)\
[CreateForceFeedbackEffect](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md)\
[IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md)\
[SetForceFeedbackMotorGain](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)\
[GameInput 上的力反馈](https://docs.xbox.com/zh-CN/build/core-features/common/input/advanced/input-forcefeedback.md)\
[IGameInputDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 版本历史

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


## Related topics

- [GameInput 上的力反馈](https://docs.xbox.com/zh-CN/build/core-features/common/input/advanced/input-forcefeedback.md)
- [IGameInputDevice::GetForceFeedbackMotorInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorinfo.md)
- [IGameInputForceFeedbackEffect::GetDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getdevice.md)
- [IGameInputDevice::GetInputReportCount](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md)
- [IGameInputDevice::GetSupportedRumbleMotors](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedrumblemotors.md)
