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

# XInputSetState

> XInputSetState

# XInputSetState

Envía datos de vibración al mando de dos motores especificado.

<a id="syntaxSection" />

## Sintaxis

```cpp theme={null}
DWORD XInputSetState(  
         DWORD dwUserIndex,  
         const XINPUT_VIBRATION * 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](/reference/input/xinputongameinput/structs/xinput_vibration)\*

Puntero a un objeto [XINPUT\_VIBRATION](/reference/input/xinputongameinput/structs/xinput_vibration) 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

Esta función admite mandos más antiguos que solo tienen dos motores de retroalimentación háptica. Para admitir motores de retroalimentación adicionales en mandos más recientes, llame a [XInputSetStateEx](/reference/input/xinputongameinput/functions/xinputsetstateex).

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

- [XInputSetStateEx](/es/reference/input/xinputongameinput/functions/xinputsetstateex.md)
- [XInputEnable](/es/reference/input/xinputongameinput/functions/xinputenable.md)
- [Portabilidad de XInput a GameInput](/es/build/core-features/common/input/porting/input-porting-xinput.md)
- [XINPUT_VIBRATION_EX](/es/reference/input/xinputongameinput/structs/xinput_vibration_ex.md)
- [XInputOnGameInput](/es/reference/input/xinputongameinput/xinputongameinput_members.md)
