DirectInput

Last updated

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.

Contents

DirectInput and XInput provide benefits over normal Win32 input events:

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]

History

DirectX included DirectInput from version 1.0 (1995). It initially offered true support only for joysticks, as the mouse and keyboard modules simply provided wrappers to the standard Win32 API. DirectX version 3.0 (1996) added support for keyboards and mice; it also improved joystick support. DirectX 5.0 (1997) included greatly improved joystick support, including adding haptic feedback, increasing the number of buttons, changing the underlying device-driver model and incorporating a COM-based API. Mouse support also increased the number of buttons seen from four to eight. In DirectX 7.0 (1999- ), 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 as of 2010 it works with Windows 98/Me and DirectX 9. DirectX 8.0 (2000), the last version with major changes, included action mapping and broader support for different types of devices.

While Microsoft initially intended that DirectInput would handle all inputs, this didn't work out. As of 2011 Microsoft no longer recommends using DirectInput for keyboards or mice, and has started pushing the newer XInput for Xbox 360 controllers. [4] In Windows Vista, Windows 7 and later Windows versions, the in-built action mapping UI has been removed. [5] DirectInput is not available for Windows Store apps.

XInput

XInput, [6] a legacy [7] API for "next generation" controllers, was introduced in December 2005 alongside the launch of the Xbox 360. This specification provided support for Xbox 360 controllers in Windows XP SP1 and subsequent operating systems, and is described by Microsoft as being easier to program for and requiring less setup than DirectInput. XInput is compatible with DirectX version 9 and later.

Xbox 360 Controller support

An Xbox 360 Controller , with the default Microsoft driver, has the following limitations with DirectInput, compared to XInput: [8]

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

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 3rd-party driver, XBCD, gives the Xbox 360 controllers the vibration support, dead zones and (optionally) independent analog/digital triggers through DirectInput its XInput driver possesses. [11] This suggests that Microsoft's Xbox 360 controller driver was given intentionally weaker DirectInput support, rather than due to any differences between DirectInput and XInput APIs. On the other hand, Xbox 360 controllers using XInput support only very basic control of vibration motors [12] [13] in contrast with greater palette of effects supported via DirectInput. [14]

Related Research Articles

<span class="mw-page-title-main">DirectX</span> Collection of multimedia related APIs on Microsoft platforms

Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct", such as Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, and so forth. The name DirectX was coined as a shorthand term for all of these APIs and soon became the name of the collection. When Microsoft later set out to develop a gaming console, the X was used as the basis of the name Xbox to indicate that the console was based on DirectX technology. The X initial has been carried forward in the naming of APIs designed for the Xbox such as XInput and the Cross-platform Audio Creation Tool (XACT), while the DirectX pattern has been continued for Windows APIs such as Direct2D and DirectWrite.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations that are often referred to by their own names. Almost all Windows programs interact with the Windows API. On the Windows NT line of operating systems, a small number use the Native API.

Direct3D is a graphics application programming interface (API) for Microsoft Windows. Part of DirectX, Direct3D is used to render three-dimensional graphics in applications where performance is important, such as games. Direct3D uses hardware acceleration if it is available on the graphics card, allowing for hardware acceleration of the entire 3D rendering pipeline or even only partial acceleration. Direct3D exposes the advanced graphics capabilities of 3D graphics hardware, including Z-buffering, W-buffering, stencil buffering, spatial anti-aliasing, alpha blending, color blending, mipmapping, texture blending, clipping, culling, atmospheric effects, perspective-correct texture mapping, programmable HLSL shaders and effects. Integration with other DirectX technologies enables Direct3D to deliver such features as video mapping, hardware 3D rendering in 2D overlay planes, and even sprites, providing the use of 2D and 3D graphics in interactive media ties.

<span class="mw-page-title-main">Game controller</span> Device used with games or entertainment systems

A game controller, gaming controller, or simply controller, is an input device or input/output device used with video games or entertainment systems to provide input to a video game. Input devices that have been classified as game controllers include keyboards, mice, gamepads, and joysticks, as well as special purpose devices, such as steering wheels for driving games and light guns for shooting games. Controllers designs have evolved to include directional pads, multiple buttons, analog sticks, joysticks, motion detection, touch screens and a plethora of other features.

<span class="mw-page-title-main">Microsoft SideWinder</span> Digital video game controllers

Microsoft SideWinder was the general name given to the family of digital game controllers developed by Microsoft for PCs. The line was first launched in 1995. Although intended only for use with Microsoft Windows, Microsoft SideWinder game controllers can also be used with macOS, Mac OS 9 with third-party software, and Linux.

<span class="mw-page-title-main">Game port</span> Computer device port

The game port is a device port that was found on IBM PC compatible and other computer systems throughout the 1980s and 1990s. It was the traditional connector for joystick input, and occasionally MIDI devices, until made obsolete by USB in the late 1990s.

<span class="mw-page-title-main">Microsoft XNA</span> Freeware set of tools by Microsoft

Microsoft XNA is a freeware set of tools with a managed runtime environment that Microsoft developed to facilitate video game development. XNA is based on .NET Framework, with versions that run on Windows and Xbox 360. XNA Game Studio can help develop XNA games. The XNA toolset was announced on March 24, 2004, at the Game Developers Conference in San Jose, California. A first Community Technology Preview of XNA Build was released on March 14, 2006.

A human interface device or HID is a type of computer device usually used by humans that takes input from or provides output to humans.

<span class="mw-page-title-main">Gamepad</span> Type of video game controller

A gamepad is a type of video game controller held in two hands, where the fingers are used to provide input. They are typically the main input device for video game consoles.

<span class="mw-page-title-main">Sixaxis</span> Wireless gamepad by Sony

The Sixaxis is a wireless gamepad produced by Sony for their PlayStation 3 video game console. It was introduced alongside the PlayStation 3 in 2006 and remained the console's official controller until 2008. The Sixaxis was succeeded by the DualShock 3, an updated version of the controller that, like the DualShock and DualShock 2 controllers, incorporates haptic technology – also known as force feedback. A Sixaxis controller can also be used with PSP Go and the PlayStation TV via Bluetooth after registering the controller on a PlayStation 3 console.

<span class="mw-page-title-main">Xbox 360 controller</span> Primary game controller for the Xbox 360

The Xbox 360 controller is the primary game controller for Microsoft's Xbox 360 home video game console that was introduced at E3 2005. The Xbox 360 controller comes in both wired and wireless versions. The Xbox controller is not compatible with the Xbox 360. The wired and wireless versions are also compatible with Microsoft PC operating systems, such as Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10, and Windows 11.

<span class="mw-page-title-main">Input device</span> Device that provides data and signals to a computer

In computing, an input device is a piece of equipment used to provide data and control signals to an information processing system, such as a computer or information appliance. Examples of input devices include keyboards, computer mice, scanners, cameras, joysticks, and microphones.

VRPN is a device-independent, network-based interface for accessing virtual reality peripherals in VR applications. It was originally designed and implemented by Russell M. Taylor II at the Department of Computer Science of the University of North Carolina at Chapel Hill. VRPN was maintained and supported by Sensics while it was business. It is currently maintained by ReliaSolve and developed in collaboration with a productive community of contributors. It is described more fully at vrpn.net and in VRPN-VRST.

Game Sprockets is a collection of application programming interfaces (APIs) supporting gaming on the classic Mac OS. It consisted of four main parts, DrawSprocket, InputSprocket, SoundSprocket and NetSprocket, each providing a library of pre-rolled routines for common gaming tasks. SpeechSprocket was a relabelled version of the Speech Recognition Manager that provided speech recognition support, and QuickDraw 3D RAVE provided 3D hardware acceleration.

<span class="mw-page-title-main">PPSSPP</span> PSP emulator

PPSSPP is a free and open-source PSP emulator for Windows, macOS, Linux, iOS, Android, Nintendo WiiU, Nintendo Switch, BlackBerry 10, MeeGo, Pandora, Xbox Series X/S and Symbian with an increased focus on speed and portability. It was first released to the public on November 1, 2012, licensed under the GNU GPLv2 or later. The PPSSPP project was created by Henrik Rydgård, one of the co-founders of the Dolphin emulator.

<span class="mw-page-title-main">Xbox</span> Video gaming brand owned by Microsoft

Xbox is a video gaming brand that consists of five home video game consoles, as well as applications (games), streaming service Xbox Cloud Gaming, and online services such as the Xbox network and Xbox Game Pass. The brand is produced by Microsoft Gaming, a division of Microsoft.

<span class="mw-page-title-main">Xbox Wireless Controller</span> Primary game controller for the Xbox platform

The Xbox Wireless Controller is the primary game controller for the Xbox One and Xbox Series X/S home video game consoles, also the official controller for use in Windows-based PCs, and compatible with other operating systems such as macOS, Linux, iOS, and Android. The controller maintains the overall layout found in the Xbox 360 controller, but with various tweaks to its design, such as a revised shape, redesigned analog sticks, shoulder buttons, and triggers, along with new rumble motors within the triggers to allow for directional haptic feedback.

<span class="mw-page-title-main">Xbox Adaptive Controller</span> Video game controller designed by Microsoft for people with disabilities

The Xbox Adaptive Controller (XAC) is a video game controller designed by Microsoft for Windows PCs and the Xbox One and Xbox Series X/S video game consoles. The controller was designed for people with disabilities to help make user input for video games more accessible.

References

  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.
  4. "Taking Advantage of High-Definition Mouse Movement". MSDN. Microsoft. Retrieved 2009-01-25.
  5. "DirectInput ConfigureDevices in Windows Vista". 2008-12-27. Archived from the original on December 27, 2008. Retrieved 2012-11-13.
  6. "Comparison of XInput and DirectInput features - Win32 apps | Microsoft Docs".
  7. "Overview of GameInput".
  8. "Comparison of XInput and DirectInput features - Win32 apps | Microsoft Docs".
  9. "XInputGetAudioDeviceIds function". MSDN. Retrieved 10 December 2013.
  10. "XInput and DirectInput". Microsoft. 2012-09-17. Retrieved 2012-12-27.
  11. "DirectInput ConfigureDevices in Windows Vista". Archived from the original on April 25, 2011. Retrieved 2020-07-17.
  12. "Gamepad - Rumbler Control". Free60 Project. Archived from the original on 2009-03-13. Retrieved 2009-01-25.
  13. "XINPUT_VIBRATION". Msdn.microsoft.com. Retrieved 2009-01-25.
  14. "DIEFFECT". MSDN. Microsoft. Retrieved 2009-01-25.