XInputGetCapabilities

Retrieves the capabilities and features of a connected controller.

DWORD XInputGetCapabilities(
  DWORD dwUserIndex,
  DWORD dwFlags,
  XINPUT_CAPABILITIES* pCapabilities
);

Parameters

dwUserIndex
[in] Index of the user's controller. Can be a value in the range 0–3. For information about how this value is determined and how the value maps to indicators on the controller, see Multiple Controllers.
dwFlags
[in] Input flags that identify the controller type. If this value is 0, then the capabilities of all controllers connected to the system are returned. Currently, only one value is supported:
Value Description
XINPUT_FLAG_GAMEPAD Limit query to devices of Xbox 360 Controller type.

Any value of dwflags other than the above or 0 is illegal and will result in an error break when debugging.

pCapabilities
[out] Pointer to an XINPUT_CAPABILITIES structure that receives the controller capabilities.

Return Values

If the function succeeds, the return value is ERROR_SUCCESS.

If the controller is not connected, the return value is ERROR_DEVICE_NOT_CONNECTED.

If the function fails, the return value is an error code defined in Winerror.h. The function does not use SetLastError to set the calling thread's last-error code.

Requirements

Header: Declared in XInput.h.

Import Library: Use Xinput.lib.

See Also

XInput Functions | XInputGetState, XInputSetState