DirectInput

From Wikipedia, the free encyclopedia

DirectInput is a library of objects for collecting input from the user, via input devices such the mouse, keyboard, joystick or game controllers. 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.

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.[1]

XInput is an API for "next generation" controllers, and was introduced with the launch of the Xbox 360, allowing Xbox 360 controller to be fully functional under Windows XP SP1 and up. XInput has the advantage that it is significantly easier to program with than DirectInput.[2] XInput is compatible with DirectX 9 and up.

When using Xbox 360 Controller with the default driver with DirectInput API, there are following changes:

  • The left and right trigger buttons will act as a single button, not independently
  • The vibration effects will not be available
  • Querying for headset devices will not be available

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.[3]

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 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:

  • Supports only "next generation" controllers. This limits it basically to controllers for the Xbox 360 that also have windows drivers. Legacy windows controllers are not supported.
  • Maximum of four controllers at a time. This is an Xbox limit that is carried over to Windows. Although there are currently few PC games that need more than four controllers at once, this seems like an arbitrary restriction as DirectInput has no such limitation.
  • Does not support keyboards, mice, or mouse-type devices. While this mirrors Microsoft's recommendation not to use DirectInput with these devices, it is possible to use DirectInput with these devices.
  • Support for only 4 axes, 10 buttons, 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 and buttons XInput supports corresponds directly to the Xbox 360 controller.)

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.