DirectInput

In computing, DirectInput is a legacy[1] Microsoft API for collecting input from a computer user, via input devices such as the mouse, 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 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[2]), and to use GameInput instead of DirectInput and other legacy APIs, such as XInput, for controllers.[3]

  1. ^ "DirectInput".
  2. ^ "Meltdown 2005 slideshow (.zip)". Archived from the original on 2015-05-21. Retrieved 2012-11-13.{{cite web}}: CS1 maint: bot: original URL status unknown (link)
  3. ^ "Overview of GameInput". p. GameInput introduction, "Getting started". 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.