Information AboutDirectinput |
| CATEGORIES ABOUT DIRECTINPUT | |
| directx | |
|
DirectInput is an API for collecting input from the user, via Input Devices such the Mouse , Keyboard , Joystick or Game Controller s. It also provides a system for ''action mapping,'' which allows you to assign specific actions within a game to the buttons and axis on your input devices. Additionally it handles ''force-feedback'' (input/output) devices. Microsoft introduced a new input library called XInput in DirectX 9 specifically for XBox 360 controllers. DirectInput and XInput have benefits over normal Win32 input events:
While DirectInput is a part of the DirectX library it has not been significantly revised since DirectX 8. It should be noted that 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. {Link without Title} , and to use XInput instead of DirectInput for XBox 360 controllers. HISTORY DirectInput has been part of DirectX from version 1.0. It initially offered true support for only joysticks, as the mouse and keyboard part were just a wrapper to the standard Win32 API. With DirectX version 3.0 support for keyboards and mice were added, and joystick support was improved. With DirectX 5.0, joystick support was greatly improved, including adding force feedback, increasing the number of buttons, and changed the underlying device driver model. Mouse support also increased the number of buttons seen from four to eight. In DirectX 7.0, 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 it still works with Windows 98/ME and DirectX 9. DirectX 8.0 was the last version with major changes, which included action mapping and broader support for different types of devices. While Microsoft initially touted that DirectInput would be the way to handle all inputs, it hasn't turned out this way. Currently Microsoft doesn't recommend using DirectInput for keyboards or mice, and is pushing the newer XInput for XBox 360 controllers. XINPUT XInput is an API for "next generation" controllers, and was introduced with the launch of the Xbox 360 , allowing Xbox 360 controllers to be fully functional under Windows XP SP1 and up. XInput has the advantage that it is significantly easier to program with than DirectInput. XInput is compatible with DirectX 9 and up. DIRECTINPUT VS XINPUT With DirectInput not having seen any major changes since DirectX 8, and XInput being introduced later in DirectX 9, there is some confusion on the current status and future of the two APIs. Currently, each have features the other doesn't, and neither had major updates with DirectX 10. When using ''Xbox 360 Controller'' with their default Microsoft driver with DirectInput, there are the following limitations compared to with XInput:
According to 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's 'solution' was to combine 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. {Link without Title} The above, however, ignores the fact that many DirectInput controllers, such as game pads with dual analog sticks and racing wheel controller sets, already map triggers and pedals independently. In addition, many DirectInput devices also have vibration effects. There is at least one driver, XBCD , that gives the Xbox 360 controllers the vibration support, dead zones and (optionally) independent triggers through DirectInput. This indicates Microsoft's Xbox 360 controller driver ''intentionally'' has weaker DirectInput support, rather than due to any differences between DirectInput and XInput APIs. The XInput API also currently has limits that DirectInput does not:
Currently, XInput is for XBox 360 controllers, while DirectInput is for any controller. SEE ALSO EXTERNAL LINKS |
|
|