Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XInputGetCapabilities function

Retrieves the capabilities and features of a connected controller.

Syntax


DWORD XInputGetCapabilities(
  _In_  DWORD               dwUserIndex,
  _In_  DWORD               dwFlags,
  _Out_ 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:

ValueDescription
XINPUT_FLAG_GAMEPADLimit 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 value

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.

Remarks

Note  The legacy XINPUT 9.1.0 version (included in Windows Vista and later) always returned a fixed set of capabilities regardless of attached device.
 

Platform Requirements

Windows 8 (XInput 1.4), DirectX SDK (XInput 1.3), Windows Vista (XInput 9.1.0)

Requirements

Header

XInput.h

Library

Xinput.lib;
Xinput9_1_0.lib

DLL

Xinput1_4.dll;
Xinput9_1_0.dll

See also

XInput Functions
XInputGetState
XInputSetState

 

 

Community Additions

Show:
© 2016 Microsoft