HOME

TheInfoList



OR:

In computing, DirectInput is a legacy
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
for collecting input from a computer user, via
input devices In computing, an input device is a piece of equipment used to provide data and control signals to an information processing system, such as a computer or information appliance. Examples of input devices include Computer keyboard, keyboards, Compu ...
such as the
mouse A mouse (: mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus'' ...
, 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 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 Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct" ...
library, it has not been significantly revised since DirectX 8 (2001–2002). Microsoft recommends that new applications make use of the Windows message loop for keyboard and mouse input instead of DirectInput (as indicated in the Meltdown 2005 slideshow), and to use GameInput instead of DirectInput and other legacy APIs, such as XInput, for controllers.


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 wrappers to the standard 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 COM-based
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
. 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 Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
, even though 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. Microsoft no longer recommends using DirectInput for keyboards or mice, and has started pushing the newer XInput for Xbox 360 controllers. In
Windows Vista Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
,
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on July 22, 2009, and became generally available on October 22, ...
and later Windows versions, the in-built action mapping UI has been removed. DirectInput is not available for Windows Store apps.


XInput

XInput, a legacy
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
for "next generation" controllers, was introduced in December 2005 alongside the launch of the
Xbox 360 The Xbox 360 is a home video game console developed by Microsoft. As the successor to the Xbox (console), original Xbox, it is the second console in the Xbox#Consoles, Xbox series. It was officially unveiled on MTV on May 12, 2005, with detail ...
. This specification provided support for Xbox 360 controllers in
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
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 Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct" ...
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: * 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. According to
MSDN Microsoft Developer Network (MSDN) was the division of Microsoft responsible for managing the firm's relationship with developers and testers, such as hardware developers interested in the operating system (OS), and software developers developing ...
, "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. The above, however, ignores the fact that many DirectInput controllers, such as gamepads with dual analog sticks and racing-wheel controller sets, already map triggers and 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. 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 in contrast with greater palette of effects supported via DirectInput.


References


External links


Microsoft's DirectInput documentation

XInput and DirectInput
{{DEFAULTSORT:Directinput Input DirectInput