Topic summary
DirectInput
DirectInput is a legacy application programming interface developed by American company Microsoft that collects user input via devices such as the mouse, keyboard, and gamepads. 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/force feedback (input/output) devices. Microsoft also introduced a input library called XInput specifically for the Xbox 360 controller.
DirectInput supports up to 128 buttons, 8 axes, and 4 point of view hats.
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), and to use GameInput instead of legacy APIs such as DirectInput or XInput.