XInputEnable function

Sets the reporting state of XInput.

Syntax


void XInputEnable(
  _In_  BOOL enable
);

Parameters

enable [in]

If enable is FALSE, XInput will only send neutral data in response to XInputGetState (all buttons up, axes centered, and triggers at 0). XInputSetState calls will be registered but not sent to the device. Sending any value other than FALSE will restore reading and writing functionality to normal.

Return value

This function does not return a value.

Remarks

This function is meant to be called when an application gains or loses focus (such as via WM_ACTIVATEAPP). Using this function, you will not have to change the XInput query loop in your application as neutral data will always be reported if XInput is disabled.

In a controller that supports vibration effects:

  • Passing FALSE will stop any vibration effects currently playing. In this state, calls to XInputSetState will be registered, but not passed to the device.
  • Passing TRUE will pass the last vibration request (even if it is 0) sent to XInputSetState to the device.

Platform Requirements

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

Requirements

Header

XInput.h

Library

Xinput.lib

See also

XInput Functions
XInputGetState
XInputSetState
XINPUT_STATE
XINPUT_GAMEPAD

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.