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

# GetMotorIndex

> IGameInputForceFeedbackEffect::GetMotorIndex

# IGameInputForceFeedbackEffect::GetMotorIndex

检索与力反馈效果关联的电机索引。

## 语法

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

### 参数

此方法没有参数。

### 返回值

类型:uint32\_t

返回关联电机的索引。

## 注解

每个 `IGameInputForceFeedbackEffect` 实例都会检索到关于该效果的一组通用信息。要获取效果在设备上所加载的具体电机，请使用 `GetMotorIndex` 方法。有关更多信息，请参见 [Advanced GameInput topics](https://docs.xbox.com/zh-CN/build/core-features/common/input/advanced/input-advanced-topics.md)。

## 要求

**头文件:** GameInput.h

**库:** xgameruntime.lib

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

## 另请参见

[GameInput 概述](https://docs.xbox.com/zh-CN/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputForceFeedbackEffect](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/igameinputforcefeedbackeffect.md)

## 版本历史

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


## Related topics

- [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)
- [IGameInputDevice::SetHapticMotorState（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_sethapticmotorstate.md)
- [GetIndex](https://docs.xbox.com/zh-CN/reference/lighting/lamparray/interfaces/ilampinfo/methods/ilampinfo_getindex.md)
- [GameInputRumbleMotors](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputrumblemotors.md)
