XInput is a cross-platform API that has shipped for use on Xbox 360 as well as versions of Windows, including Windows XP, Windows Vista, Windows 7, and Windows 8. On Xbox 360, XInput ships as a static library that is compiled into the main game executable. On Windows, XInput is provided as a DLL that is installed into the system folders of the operating system.
There are three current versions of the XInput DLL today. Choose the appropriate version of XInput based on the functionality of XInput you use and the versions of Windows you intend to support.
- XInput 1.4: XInput 1.4 ships as part of Windows 8. Use this version for building Windows Store apps or if your desktop app requires Windows 8.
- XInput 9.1.0: XInput 9.1.0 ships as part of Windows Vista, Windows 7, and Windows 8. Use this version if your desktop app is intended to run on these versions of Windows and you are using basic XInput functionality.
- XInput 1.3: XInput 1.3 ships as a redistributable component in the DirectX SDK with support for Windows Vista, Windows 7, and Windows 8. Use this version if your desktop app is intended to run on these versions of Windows and you need functionality that is not supported by XInput 9.1.0.
XInput 1.4 ships today as a system component in Windows 8 as XINPUT1_4.DLL. It is available “inbox” and does not require redistribution with an application. The Windows Software Development Kit (SDK) contains the header and import library for statically linking against XINPUT1_4.DLL. To download the Windows 8 SDK, see Downloads for developing desktop apps.
XInput 1.4 has these primary advantages over other versions of XInput:
- This is the only version that can be used in C++/DirectX Windows Store apps.
- The new XInputGetAudioDeviceIds function provides an audio device ID string that you can use to open an XAudio2 mastering voice or audio device for a headset attached to an Xbox 360 common controller. The XInputGetDSoundAudioDeviceGuids function is not available in this version.
- Provides improved device capabilities reporting including XINPUT_CAPS_WIRELESS, XINPUT_CAPS_FFB_SUPPORTED, XINPUT_CAPS_PMD_SUPPORTED, and XINPUT_CAPS_NO_NAVIGATION flags and more accurate reporting of XINPUT_CAPS_VOICE_SUPPORTED. These flags are combined in the Flags member of the XINPUT_CAPABILITIES structure. The XInputGetCapabilities function returns XINPUT_CAPABILITIES.
Like XInput 1.4, XInput 9.1.0 ships today as a system component in Windows 8, Windows 7, and Windows Vista as XINPUT9_1_0.DLL. It is maintained primarily for backward compatibility with existing applications. It has a reduced function set so we recommend that you use XInput 1.4 on Windows 8. But it is convenient to use for applications that must run on down-level versions of Windows but don't need the additional functionality provided by XInput 1.4 or XInput 1.3.
The Windows SDK contains the header and import library for statically linking against XINPUT9_1_0.DLL.
XInput 1.4 has these disadvantages over other versions of XInput:
- For backward compatibility reasons, XInputGetCapabilities in this version of XInput returns fixed capability information. Regardless of Xbox 360 common controller device attached, XInputGetCapabilities in XInput 1.4 will always report a device subtype of GAMEPAD. It will not return the XINPUT_CAPS_WIRELESS capability bit even if a wireless device is connected.
- You can't determine the headset for a given user ID. The XInputGetAudioDeviceIds function is not available and XInputGetDSoundAudioDeviceGuids function will return no results on Windows 8.
- The XInputEnable, XInputGetBatteryInformation, and XInputGetKeystroke functions are not available.
Some previous versions of XInput have been provided as redistributable DLLs in the DirectX SDK. The first redistributable version of XInput, XInput 1.1, shipped in the April 2006 release of the DirectX SDK. The last version to ship in the DirectX SDK was XInput 1.3, available in the June 2010 release of the DirectX SDK. For access to these versions of XInput, download previous versions of the DirectX SDK from the Microsoft Download Center. We shipped the last version of the DirectX SDK in June 2010.
You can use XInput 1.3 for applications that support down-level versions of Windows and require functionality not provided by XInput 9.1.0 (that is, correct subtype reporting, audio support, explicit battery reporting support, and so on).