XInputSetStateEx
Sends vibration data to the specified controller. Supports the four-motor vibration capability of newer controllers.Syntax
Parameters
dwUserIndex _In_Type: DWORD Index of the gamer associated with the device; a value in the range of 0 to
XUSER_MAX_COUNT - 1.
pVibration _In_Type: XINPUT_VIBRATION_EX* Pointer to an XINPUT_VIBRATION_EX object that contains the vibration information to be sent to the controller.
Return value
Type: DWORD If the function succeeds, it returnsERROR_SUCCESS.
If the controller is not connected, the function returns ERROR_DEVICE_NOT_CONNECTED.
If the function fails, it returns an error code defined in WinError.h.
Remarks
Calling this function is safe even during an interaction with a two-motor controller. Any vibration setting sent toXInputSetStateEx for a two-motor controller will be adjusted to ensure that the controller still vibrates with its best approximation for the input sent. For this reason, we recommend that you call XInputSetStateEx in situations where you would call XInputSetState.
For more information, see The XInputOnGameInput wrapper.
Requirements
Header: XInputOnGameInput.h Library: xgameruntime.lib Supported platforms: XBOX One family consoles and XBOX Series consolesSee also
Porting from XInput to GameInputXInputOnGameInput
