> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XInputSetStateEx

> XInputSetStateEx

# XInputSetStateEx

Envía datos de vibración al mando especificado. Admite la funcionalidad de vibración de cuatro motores de los mandos más recientes.

<a id="syntaxSection" />

## Sintaxis

```cpp theme={null}
DWORD XInputSetStateEx(  
         DWORD dwUserIndex,  
         const XINPUT_VIBRATION_EX * pVibration  
)  
```

<a id="parametersSection" />

### Parámetros

*dwUserIndex*   \_In\_\
Tipo: DWORD

Índice del jugador asociado al dispositivo; un valor en el intervalo de 0 a `XUSER_MAX_COUNT - 1`.

*pVibration*   \_In\_\
Tipo: [XINPUT\_VIBRATION\_EX](/reference/input/xinputongameinput/structs/xinput_vibration_ex)\*

Puntero a un objeto [XINPUT\_VIBRATION\_EX](/reference/input/xinputongameinput/structs/xinput_vibration_ex) que contiene la información de vibración que se enviará al mando.

<a id="retvalSection" />

### Valor devuelto

Tipo: DWORD

Si la función se ejecuta correctamente, devuelve `ERROR_SUCCESS`.

Si el mando no está conectado, la función devuelve `ERROR_DEVICE_NOT_CONNECTED`.

Si la función da error, devuelve un código de error definido en WinError.h.

<a id="remarksSection" />

## Comentarios

Llamar a esta función es seguro incluso durante una interacción con un mando de dos motores. Cualquier configuración de vibración enviada a `XInputSetStateEx` para un mando de dos motores se ajustará para garantizar que el mando siga vibrando con la mejor aproximación posible a la entrada enviada. Por este motivo, se recomienda llamar a `XInputSetStateEx` en las situaciones en las que llamaría a [XInputSetState](/reference/input/xinputongameinput/functions/xinputsetstate).

Para obtener más información, consulte [El contenedor XInputOnGameInput](/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection).

<a id="requirementsSection" />

## Requisitos

**Encabezado:** XInputOnGameInput.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** consolas de la familia XBOX One y consolas XBOX Series

<a id="seealsoSection" />

## Consulte también

[Portabilidad de XInput a GameInput](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XInputSetState](/es/reference/input/xinputongameinput/functions/xinputsetstate.md)
- [XINPUT_VIBRATION_EX](/es/reference/input/xinputongameinput/structs/xinput_vibration_ex.md)
- [XINPUT_VIBRATION](/es/reference/input/xinputongameinput/structs/xinput_vibration.md)
- [XInputOnGameInput](/es/reference/input/xinputongameinput/xinputongameinput_members.md)
- [Portabilidad de XInput a GameInput](/es/build/core-features/common/input/porting/input-porting-xinput.md)
