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

# XInputGetState

> XInputGetState

# XInputGetState

Recupera el estado actual del mando especificado.

<a id="syntaxSection" />

## Sintaxis

```cpp theme={null}
DWORD XInputGetState(  
         DWORD dwUserIndex,  
         XINPUT_STATE * pState  
)  
```

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

*pState*   \_Out\_\
Tipo: [XINPUT\_STATE](/reference/input/xinputongameinput/structs/xinput_state)\*

Puntero a un objeto [XINPUT\_STATE](/reference/input/xinputongameinput/structs/xinput_state) que recibe el estado actual del 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 notifica los gatillos izquierdo y derecho por separado. En DirectInput, los dos gatillos compartían el mismo eje.

La función [XInputGetStateWithToken](/reference/input/xinputongameinput/functions/xinputgetstatewithtoken) es similar, pero permite que el autor de la llamada proporcione un token de canalización de fotogramas D3DX para asociar una lectura de entrada específica con un fotograma gráfico para su posterior análisis en PIX.

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

- [XInputGetStateWithToken](/es/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md)
- [XINPUT_STATE](/es/reference/input/xinputongameinput/structs/xinput_state.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)
- [XInputOnGameInput](/es/reference/input/xinputongameinput/xinputongameinput_members.md)
