07-05-10, 10:03 PM
Join Date: Jul 2004
Re: We Need a Pressure Sensitive Keypad Bad
As far as I know the standard is already there, it's called DirectInput and XInput and every control uses one or the other. Older stuff uses DirectInput and newer stuff uses XInput API. Most newer games only use XInput now and that's also why a lot of rumble devices programmed in DirectInput no longer vibrate.
DirectInput vs XInput
Microsoft has not made any major changes to DirectInput since DirectX 8, and introduced XInput later in DirectX 9: there remains some confusion about the current status and future of the two APIs. As of 2010[update] each has features the other doesn't, and neither had major updates with DirectX 10 (2006- ).
An Xbox 360 Controller with the default Microsoft driver with DirectInput has the following limitations compared to with XInput:
the left and right triggers will act as a single axis, not as independent analog axes
vibration effects will not operate
querying for headset devices will not operate
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 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 driver, XBCD, gives the Xbox 360 controllers the vibration support, dead zones and (optionally) independent triggers through DirectInput. This suggests that Microsoft's Xbox 360 controller driver intentionally has weaker DirectInput support, rather than due to any differences between DirectInput and XInput APIs. On the other hand, Xbox 360 controller and XInput support only very basic control of vibration motors in contrast with great palette of various effects supported by DirectInput. The XBCD driver emulates support of these DirectInput vibration effects in the driver and translates them to simple commands for each motor in the controller. This approach makes reproduction of some DirectInput effects inaccurate.
The XInput API also as of 2010[update] has limits that DirectInput does not:
XInput supports only "next generation" controllers. This limits it basically to controllers for the Xbox 360 that also have Windows drivers. Legacy Windows controllers, joysticks and generalized force-feedback devices are not supported.
XInput supports a maximum of four controllers at a time. This is an Xbox limit, carried over to Windows. Although as of 2010[update] few PC games require more than four controllers at once, this seems[original research?] like an arbitrary restriction as DirectInput has no such limitation.
XInput does not support keyboards, mice, or mouse-type devices. While this mirrors Microsoft's recommendation not to use DirectInput with these devices, programmers can use DirectInput with these devices.
XInput supports maxima of 4 axes, 10 buttons, 2 triggers and 8-direction digital pad per controller, compared to DirectInput's support for 8 axes, 128 buttons, and full-range POV. (Incidentally, the number of axes, buttons and triggers XInput supports corresponds directly to the Xbox 360 controller.)
As of 2010[update] XInput is for Xbox 360 controllers, while DirectInput is for any controller.
Gigabyte V1.1 EP45-UD3R F5
GO-Q6600@3.6GHz 1/2" D5/GTZ Block W/BIX-II Dual 120mm
Corsair 4GB Dominator DDR2-8500 5-5-5-15 2t@1066GHz
Evga 280 GTX 621/1349/2268
SB X-Fi FPS / Z-5500 + Buttkicker!
"Don't mind the posts, I've been around longer than most know."