> ## 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::SetHapticMotorState（已弃用）

> IGameInputDevice::SetHapticMotorState

# IGameInputDevice::SetHapticMotorState

> [!WARNING]
>
> **已弃用。** 此方法已在 GameInput v1 中移除，当前 API 中不再提供。

设置设备上指定马达的触觉马达状态。

## 语法

```cpp theme={null}
HRESULT SetHapticMotorState(
    uint32_t motorIndex,
    const GameInputHapticFeedbackParams* params
);
```

### 参数

*motorIndex*   \_In\_\
类型：uint32\_t

要设置的触觉马达的从零开始的索引。

*params*   \_In\_\
类型：const [GameInputHapticFeedbackParams](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/structs/gameinputhapticfeedbackparams.md)\*

指向描述要播放的触觉效果的 [GameInputHapticFeedbackParams](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/structs/gameinputhapticfeedbackparams.md) 结构的指针。

### 返回值

类型：HRESULT

返回 E\_NOTIMPL，因为此方法在 v0 中从未实现。

## 备注

此方法与 [GameInputHapticFeedbackParams](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/structs/gameinputhapticfeedbackparams.md) 结构一同在 v1 中被移除。当前 API 中的触觉反馈通过 [IGameInputDevice::SetForceFeedbackMotorGain](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md) 和 [IGameInputForceFeedbackEffect](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/igameinputforcefeedbackeffect.md) 进行控制。

## 版本历史

| 版本 | 变更 |
| - | - |
| **v1** | 已移除。 |
| **v0** | 已引入。 |

## 另请参阅

[已弃用的 GameInput API 成员](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/gameinput_deprecated_members.md)\
[GameInputHapticFeedbackParams](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/structs/gameinputhapticfeedbackparams.md)\
[IGameInputDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)


## Related topics

- [IGameInputDevice::SetInputSynchronizationState（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_setinputsynchronizationstate.md)
- [GameInputHapticFeedbackMotorInfo（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/structs/gameinputhapticfeedbackmotorinfo.md)
- [IGameInputDevice::SendInputSynchronizationHint（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_sendinputsynchronizationhint.md)
- [IGameInputDevice::GetBatteryState（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getbatterystate.md)
- [IGameInputDevice::SetRawDeviceFeature（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md)
