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

# XInputEnable

> XInputEnable

# XInputEnable

Sets the reporting state of XInput.

## Syntax

```cpp theme={null}
void XInputEnable(  
         BOOL enable  
)  
```

### Parameters

*enable*   \_In\_\
Type: BOOL

If enable is **FALSE**, XInput will send only neutral data in response to [XInputGetState](/reference/input/xinputongameinput/functions/xinputgetstate): that is, all buttons up, axes centered, and triggers at 0. [XInputSetState](/reference/input/xinputongameinput/functions/xinputsetstate) calls will be registered but won't be sent to the device. Sending any value other than **FALSE** will restore the reading and writing functionality to normal.

### Return value

Type: void

None.

## Remarks

This function is deprecated and shouldn't be written into any new code. XInputEnable adds overhead to many XInput wrapper calls. You can `#define XINPUT_ON_GAMEINPUT_NO_XINPUTENABLE` to get rid of XInputEnable and the resulting overhead. For more information, see [Porting from XInput to GameInput](/build/core-features/common/input/porting/input-porting-xinput#optimizingSection).

This function is meant to be called when an application gains or loses focus. When using this function, you won't have to change the XInput query loop in your application, because neutral data will always be reported if XInput is disabled.

In a controller that supports vibration effects:

* Passing **FALSE** will stop any vibration effects playing at the moment. In this state, calls to [XInputSetState](/reference/input/xinputongameinput/functions/xinputsetstate) will be registered but won't be passed to the device.
* Passing **TRUE** will pass the last vibration request (even if it's 0) sent to [XInputSetState](/reference/input/xinputongameinput/functions/xinputsetstate) and to the device.

## Requirements

**Header:** XInputOnGameInput.h

**Library:** xgameruntime.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

[Port XInput to GameInput](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)\
[XInputGetState](/reference/input/xinputongameinput/functions/xinputgetstate)\
[XInputSetState](/reference/input/xinputongameinput/functions/xinputsetstate)


## Related topics

- [Porting from XInput to GameInput](/build/core-features/common/input/porting/input-porting-xinput.md)
- [XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members.md)
- [IGameInput::EnableOemDeviceSupport](/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_enableoemdevicesupport.md)
- [XGameStreamingIsTouchInputEnabled](/reference/system/xgamestreaming/functions/xgamestreamingistouchinputenabled.md)
- [Content Test Application (CTA) Stream Configuration Overview](/build/core-features/common/game-streaming/game-streaming-content-test-application-stream-config.md)
