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

# XINPUT_VIBRATION

> XINPUT_VIBRATION

# XINPUT\_VIBRATION

描述双电机控制器振动功能的电机速度。

## 语法

```cpp theme={null}
typedef struct XINPUT_VIBRATION {  
    WORD wLeftMotorSpeed;  
    WORD wRightMotorSpeed;  
} XINPUT_VIBRATION  
```

### 成员

*wLeftMotorSpeed*\
类型：WORD

左电机的速度。有效值范围为 0 到 65535。零表示完全不使用该电机，65535 表示该电机以 100% 使用。

*wRightMotorSpeed*\
类型：WORD

右电机的速度。有效值范围为 0 到 65535。零表示完全不使用该电机，65535 表示该电机以 100% 使用。

## 备注

左电机是低频震动电机。右电机是高频震动电机。这两个电机并不相同，会产生不同的振动效果。

此结构由 [XInputSetState](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputsetstate.md) 函数使用。

有关详细信息，请参阅 [XInputOnGameInput 包装器](https://docs.xbox.com/zh-CN/build/core-features/common/input/porting/input-porting-xinput.md#xinputWrapperSection)。

## 要求

**头文件：** XInputOnGameInput.h

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

## 另请参阅

[XInputSetStateEx](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputsetstateex.md)\
[从 XInput 移植到 GameInput](https://docs.xbox.com/zh-CN/build/core-features/common/input/porting/input-porting-xinput.md)\
[XInputOnGameInput](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/xinputongameinput_members.md)


## Related topics

- [XInputSetState](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputsetstate.md)
- [XInputOnGameInput（API 内容）](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/xinputongameinput_members.md)
- [XINPUT_CAPABILITIES](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_capabilities.md)
- [XINPUT_VIBRATION_EX](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_vibration_ex.md)
- [XInputSetStateEx](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputsetstateex.md)
