> ## 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-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md)、[IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md) 和 [SetForceFeedbackMotorGain](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)。使用 [GetForceFeedbackMotorInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorinfo.md) 找出每個馬達支援哪些軸和效果類型。在裝置連線期間，馬達數目不會變更。

在 GameInput v3 及更早版本中，此資訊可從 [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) 所傳回 [GameInputDeviceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 結構的 `forceFeedbackMotorCount` 成員取得。

## 需求

**標頭：** GameInput.h

**程式庫：** gameinput.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[GameInput 概觀](https://docs.xbox.com/zh-TW/build/core-features/common/input/overviews/input-overview.md)\
[GetForceFeedbackMotorInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorinfo.md)\
[CreateForceFeedbackEffect](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md)\
[IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md)\
[SetForceFeedbackMotorGain](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)\
[GameInput 上的力回饋](https://docs.xbox.com/zh-TW/build/core-features/common/input/advanced/input-forcefeedback.md)\
[IGameInputDevice](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v4** | 已推出。 |


## Related topics

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