What is the difference between XInput and DirectInput, and why does that matter to you, the end user? Today, I’ll be discussing the distinction between these two input APIs and the devices that use them so you understand the feature differences and which might be best for your game. I’ll also discuss the history and current implementation of both APIs.
Let’s get into it!
Table of Contents
What Is The Difference Between XInput and DirectInput? What You Need To Know
What Is DirectInput?
DirectInput is a legacy input API introduced to Windows back in 1995, being introduced alongside the first version of DirectX as the primary manner of supporting full-sized joysticks and other such controllers. DirectInput has remained in Windows since, but has not been significantly changed since DirectX8, and has mostly been superseded by XInput…more on that later.
What Is XInput?
XInput is a newer input API introduced to Windows in December 2005, just a month after the launch of the Xbox 360 and its corresponding controller. And this is no coincidence: the entire purpose of the XInput API was to improve Xbox 360 controller compatibility on PC and standardize input for controllers on PC. Newer Xbox controllers still use XInput, and the majority of gamepads on the market are either built explicitly for XInput or have an XInput toggle of some kind for use with PC.
What Controllers Use DirectInput?
Pretty much, any retro game controller (including the original Xbox controller prior to the 360) is going to use DirectInput when connected to PC, though you may need to install the appropriate driver for such functionality. Additionally, many non-standard controller designs (particularly those with more buttons and/or sticks than an Xbox controller can support, including older sim racing wheels and joysticks) primarily support DirectInput instead of XInput.
Is DirectInput Still Supported?
Over time, must peripherals have trended toward supporting XInput rather than DirectInput, for the sake of plug-and-play compatibility and simplicity. However, some devices will instead toggle between the two and may even support more buttons or features with DirectInput enabled, like the six-face-button Sanwa Direct USB controller used in my example above. Such a controller design restricted only to XInput would have to trade away triggers or bumpers to make room for more face buttons.
Is DirectInput Better Than XInput?
In select cases, yes!
The primary advantages of DirectInput over XInput are as follows:
- DirectInput supports any number of connected controllers at a time, not just four.
- DirectInput supports mouse and keyboard input, though this isn’t officially recommended by Microsoft.
- As mentioned prior, DirectInput supports far more sticks and buttons than DirectInput. Compared to XInput’s support for a maximum of 10 buttons, for example, DirectInput can support up to 128 buttons. This makes DirectInput ideal for use with non-standard input devices, including older sim racing wheels and the such.
Of course, XInput has plenty of its own benefits…but the main one really is just that plug-and-play compatibility and Xbox controller mapping. XInput has made the Xbox controller layout standard across PC games as a whole, and this is mostly a good thing…but some things were lost in that transition. Fortunately, that old hardware and those old games that only support DirectInput still exist…and yes, DirectInput games can be played without a DInput device if you use reWASD.
Can DirectInput Controllers Be Used With XInput Games?
If your XInput game of choice is running through Steam, simply enabling Steam Input in your Steam Controller Settings and checking “Enable Generic Controllers” should do the trick. Alternatively, if your DirectInput controller is an older PlayStation or Nintendo controller, enable those corresponding options in the window screenshotted above.
For non-Steam games, you may need an XInput wrapper for your controller of choice. For example, Xbox 360 Controller Emulator (xbox360ce) and Universal Control Remapper (UCR) should both allow for DirectInput controllers to be detected as XInput controllers in your games of choice.
Can XInput Controllers Be Used With DirectInput Games?
Using software like reWASD or JoyToKey, you can rebind a wide variety of XInput (and other) controllers to function with games that otherwise only work through DirectInput or Mouse and Keyboard. This is particularly useful for non-Steam games, where you can’t rely on Steam Input’s generous rebinding functionalities to make your inputs work in legacy titles.
What Is GameInput?
Last but not least, let’s take a moment to talk about GameInput!
GameInput currently exists in limited form, but is Microsoft’s latest input API. The main purpose of GameInput seems to be combining support for DirectInput, XInput, Raw Input, Human Interface Device, and even WinRT APIs into one all-in-one package.
GameInput is also meant to add additional features on top of the legacy APIs rolled together inside it, including Direct Memory Access for lower input latency and improved support for haptics and force feedback versus XInput.