DirectInput vs. XInput for Game Controllers: What's the Difference?
Quick Links
If you're connecting a USB or wireless game controller to your Windows PC, you might encounter terms like "DirectInput" and "XInput." But what do they mean, and what's the difference? We'll explain.
They're Microsoft Game Controller APIs
In computing, an API is an Application Programming Interface, which is a standardized way that two programs can talk to each other. In this case, when you hook a controller up to your PC, Windows makes the connection to the controller hardware, then the API allows a game to read the controller's inputs in a standardized way. This lets Windows games easily support many different types of controllers instead of having a patchwork of custom controller drivers and interfaces.
The two main gaming input APIs in Windows are called DirectInput and XInput. To put it another way, these APIs are like two different languages that a game controller might speak. Some controllers can only speak one "language" (XInput or DirectInput), while others can "speak" both APIs in different modes. If the game expects XInput but the controller only "speaks" DirectInput, that controller won't work with that game, and vice-versa.
Here's a quick look at the origins of each one:
- DirectInput: This gaming input API first appeared in 1995 as part of DirectX 1.0 for gaming on Windows 95, then supported on subsequent versions of Windows. It's a legacy interface supported by many PC game controllers released before 2005, and also some controllers (and retro controller adapters) after that time.
- XInput: This API launched in 2005 as a way to support Xbox 360 controllers on Windows. Xbox One and Xbox Series X|S controllers also currently use XInput on Windows. XInput originated as an Xbox controller-exclusive API, but many third-party controllers (not made by Microsoft) now also support it. This means they will work with games programmed to use Xinput.
The two APIs do similar things, but DirectInput is older than XInput and has been deprecated by Microsoft. Still, DirectInput supports some features that XInput does not, which is partially why the standard is still in use. In the section below, we'll compare and contrast the two standards in more detail.
Differences: DirectInput vs. XInput
Even though XInput has been around now for 17 years, some modern games still support DirectInput controllers. One reason why is because there's a large installed base of legacy controllers out there that some people still like to use.
Also, DirectInput supports more inputs than XInput (8 axes, 128 buttons, and POV for DirectInput vs. 4 axes and 10 buttons, two triggers, and D-pad for XInput), which comes in handy for complex simulation games, such as flight simulators and some racing games, where people build complex cockpit control setups. Also, Xinput only supports four controllers. If you need more than that, DirectInput is your best choice.
The advantages of XInput over DirectInput are mostly on the developer end of things. Microsoft says that XInput is "easier to use" and requires less setup for programmers. A game developer that makes an Xbox game can more easily translate the game to Windows with Xbox controller support. Also, Xbox controllers only vibrate with XInput, and the API handles the trigger buttons as two separate inputs instead of a single positive/negative axis on DirectInput.
In another win for XInput, the API will automatically understand the layout of the controller without needing to manually bind each button to a function in a game. With DirectInput, the game can't necessarily assume the shape or layout of the controller. With XInput, games use a standard Xbox-style control scheme that maps universally to every game, similar to an Xbox game console.
In general, the future of Windows gaming lies with XInput, but like many legacy Windows technologies, DirectInput continues to hold on for niche use cases. Luckily, if you have a favorite DirectInput controller that you want to use with an XInput-only game, you can use a utility such as x360ce to adapt it to XInput. Happy gaming!
ncG1vNJzZmivp6x7qbvWraagnZWge6S7zGhucmppbYFwsMirnJysmaO9tsCMr6pnZaieu7HB02adqKpdnK6usYycpqesoqS5rbHRrGSwoJGpwG7Ax55knaGWm7Kzsc2cnGg%3D