Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
DirectInput
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Microsoft API}} {{Redirect|XInput|the X Window System XInput extension|X Window System protocols and architecture}} In computing, '''DirectInput''' is a legacy<ref>{{Cite web|url=https://docs.microsoft.com/previous-versions/windows/desktop/ee416842(v=vs.85)|title=DirectInput|date=10 September 2011 }}</ref> [[Microsoft]] [[API]] for collecting input from a computer user, via [[list of input devices|input devices]] such as the [[computer mouse|mouse]], [[computer keyboard|keyboard]], or a [[gamepad]]. It also provides a system for ''action mapping,'' which allows the user to assign specific actions within a game to the buttons and axes of the input devices. Additionally it handles ''[[haptic technology#Video games|haptic feedback]]'' (input/output) devices. Microsoft introduced a new input library called XInput specifically for the [[Xbox 360 controller]]. DirectInput and XInput provide benefits over normal Win32 input events: * they enable an application to retrieve data from input devices even when the application is in the background * they provide full support for any type of input device, as well as for ''haptic feedback'' * through ''action mapping'', applications can retrieve input data without needing to know what kind of device generated that input While DirectInput forms a part of the [[DirectX]] library, it has not been significantly revised since DirectX 8 (2001β2002). Microsoft recommends that new applications make use of the [[Message loop in Microsoft Windows|Windows message loop]] for keyboard and mouse input instead of DirectInput (as indicated in the Meltdown 2005 slideshow<ref>{{cite web |url=http://download.microsoft.com/download/b/0/0/b0095d07-01fe-47f1-ad3c-fc463f88ef83/Meltdown2005.zip |title=Meltdown 2005 slideshow (.zip) |access-date=2012-11-13 |url-status=bot: unknown |archive-url=https://web.archive.org/web/20150521162503/http://download.microsoft.com/download/b/0/0/b0095d07-01fe-47f1-ad3c-fc463f88ef83/Meltdown2005.zip |archive-date=2015-05-21 }}</ref>), and to use GameInput instead of DirectInput and other legacy APIs, such as XInput, for controllers.<ref>{{cite web |title=Overview of GameInput |date=28 March 2024 |url=https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/input/overviews/input-overview |page=GameInput introduction, "Getting started" |quote=GameInput is the recommended API for all new code, regardless of the target platform, because it provides support across all Microsoft platforms (including earlier versions of Windows), and provides superior performance versus legacy APIs.}}</ref> == History == DirectX included DirectInput from version 1.0 (1995). It initially offered true support only for joysticks, as the mouse and keyboard modules simply provided [[Driver wrapper|wrapper]]s to the standard [[Windows API|Win32 API]]. DirectX version 3.0 (1996) added support for keyboards and mice; it also improved joystick support. DirectX 5.0 (1997) included greatly improved joystick support, including adding haptic feedback, increasing the number of buttons, changing the underlying device-driver model and incorporating a [[Component Object Model|COM]]-based [[Application programming interface|API]]. Mouse support also increased the number of buttons seen from four to eight. In DirectX 7.0 (1999- ), DirectInput added a long-promised feature of seeing individual mice much like individual joysticks, but the feature didn't work with the later released [[Windows XP]], even though {{as of | 2010 | lc = on}} it works with Windows 98/Me and DirectX 9. DirectX 8.0 (2000), the last version with major changes, included action mapping and broader support for different types of devices. While Microsoft initially intended that DirectInput would handle all inputs, this didn't work out. {{As of | 2011}} Microsoft no longer recommends using DirectInput for keyboards or mice, and has started pushing the newer XInput for Xbox 360 controllers.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/ee418864.aspx |title=Taking Advantage of High-Definition Mouse Movement |work=MSDN |publisher=Microsoft |access-date=2009-01-25}} </ref> In [[Windows Vista]], [[Windows 7]] and later Windows versions, the in-built action mapping UI has been removed.<ref>{{cite web|url=http://forums.microsoft.com/msdn/showpost.aspx?postid=1198467&siteid=1 |title=DirectInput ConfigureDevices in Windows Vista |date=2008-12-27 |access-date=2012-11-13 |url-status=dead |archive-url=https://web.archive.org/web/20081227003119/http://forums.microsoft.com/msdn/showpost.aspx?postid=1198467&siteid=1 |archive-date=December 27, 2008 }}</ref> DirectInput is not available for Windows Store apps. == XInput == XInput,<ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx |title = Comparison of XInput and DirectInput features - Win32 apps {{!}} Microsoft Docs| date=25 October 2023 }}</ref> a legacy<ref>{{cite web |title=Overview of GameInput |date=28 March 2024 |url=https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/input/overviews/input-overview}}</ref> [[API]] for "next generation" controllers, was introduced in December 2005 alongside the launch of the [[Xbox 360]]. This specification provided support for Xbox 360 controllers in [[Windows XP]] SP1 and subsequent operating systems, and is described by Microsoft as being easier to program for and requiring less setup than DirectInput. XInput is compatible with [[DirectX]] version 9 and later. ==Xbox 360 Controller support== An ''[[Xbox 360 Controller]]'', with the default Microsoft driver, has the following limitations with DirectInput, compared to XInput:<ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx |title = Comparison of XInput and DirectInput features - Win32 apps {{!}} Microsoft Docs| date=25 October 2023 }}</ref> * the left and right triggers will act as a single axis representing the signed difference between the triggers, not as independent analog axis * vibration effects will not operate * querying for headset devices will not operate, XInput 1.4 as part of Windows 8 introduced Xbox headset support.<ref>{{cite web|title=XInputGetAudioDeviceIds function|url=https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.directx_sdk.reference.xinputgetaudiodeviceids.aspx|publisher=MSDN|access-date=10 December 2013}}</ref> According to [[Msdn|MSDN]], "the combination of the left and right triggers in DirectInput is by design. Games have always assumed that DirectInput device axes are centered when there is no user interaction with the device. However, the Xbox 360 controller was designed to register minimum value, not center, when the triggers are not being held." MSDN proffered the "solution" of combining the triggers, setting one trigger to a positive direction and the other to a negative direction, so no user interaction is indicative to DirectInput of the "control" being at center.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/ee417014%28VS.85%29.aspx |title=XInput and DirectInput |publisher=Microsoft |date=2012-09-17 |access-date=2012-12-27}}</ref> The above, however, ignores the fact that many DirectInput controllers, such as [[gamepad]]s with dual analog sticks and [[Game controller#Steering wheel|racing-wheel]] controller sets, already map triggers and [[Game controller#Pedals|pedals]] independently. In addition, many DirectInput devices also have vibration effects. At least one 3rd-party driver, XBCD, gives the Xbox 360 controllers the vibration support, dead zones and (optionally) independent analog/digital triggers through DirectInput its XInput driver possesses.<ref>{{cite web|url=http://www.matt-land.com/xbcd/ |title=DirectInput ConfigureDevices in Windows Vista |access-date=2020-07-17 |url-status=dead |archive-url=https://web.archive.org/web/20110425142352/http://www.matt-land.com/xbcd/ |archive-date=April 25, 2011 }}</ref> This suggests that Microsoft's Xbox 360 controller driver was given ''intentionally'' weaker DirectInput support, rather than due to any differences between DirectInput and XInput APIs. On the other hand, Xbox 360 controllers using XInput support only very basic control of vibration motors<ref>{{cite web|url=http://www.free60.org/wiki/Gamepad#Rumbler_Control|archive-url=https://web.archive.org/web/20090313051343/http://free60.org/wiki/GamePad#Rumbler_Control|archive-date=2009-03-13 |title=Gamepad - Rumbler Control |publisher=Free60 Project |access-date=2009-01-25}}</ref><ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/bb174835(VS.85).aspx |title=XINPUT_VIBRATION |publisher=Msdn.microsoft.com |access-date=2009-01-25}}</ref> in contrast with greater palette of effects supported via DirectInput.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/bb219645(VS.85).aspx |title=DIEFFECT |work=MSDN |publisher=Microsoft |access-date=2009-01-25}}</ref> == References == {{reflist}} == External links == * [https://archive.today/20130103214228/http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/input/directinputroadmap.asp Microsoft's DirectInput documentation] * [https://msdn.microsoft.com/en-us/library/ee417014%28VS.85%29.aspx XInput and DirectInput] {{Microsoft APIs}} {{DEFAULTSORT:Directinput}} [[Category:DirectX|Input DirectInput]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:As of
(
edit
)
Template:Cite web
(
edit
)
Template:Microsoft APIs
(
edit
)
Template:Redirect
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)