Device Class (Microsoft.DirectX.DirectInput)

Applications use the methods of the Device object to gain and release access to Microsoft® DirectInput® devices, manage device properties and information, set behavior, perform initialization, create and play force-feedback effects, and invoke a device's control panel.


Visual Basic NotInheritable Public Class Device
    Inherits MarshalByRefObjectLeave Site
    Implements IDisposableLeave Site
C# public sealed class Device : MarshalByRefObjectLeave Site, IDisposableLeave Site
C++ public ref class Device sealed : MarshalByRefObjectLeave Site, IDisposableLeave Site
JScript public final class Device extends MarshalByRefObjectLeave Site implements IDisposableLeave Site

Members Table

The following table lists the members exposed by the object.


Method Description
Acquire Obtains access to the input device.
BuildActionMap Builds an action map for the device and retrieves information about it.
Device Initializes a new instance of the object.
Dispose Immediately releases the unmanaged resources used by an object.
Equals Returns a value that indicates whether the current instance is equal to a specified object.
Finalize Called during garbage collection. If implemented, allows an object to free resources before it is destroyed by the garbage collector.
GetBufferedData Retrieves buffered data from the device.
GetCurrentKeyboardState Retrieves immediate data from the device.
GetEffects Enumerates all the effects supported by the force-feedback system on the device. The enumerated GUIDs can represent predefined effects, as well as effects peculiar to the device manufacturer.
GetHashCode Returns the hash code for the current instance.
GetObjectInformation Retrieves information about a device object, such as a button or axis.
GetObjects Enumerates the input and output objects available on a device.
GetPressedKeys Retrieves the currently pressed keys on a keyboard device.
static (Shared in Visual Basic) op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
static (Shared in Visual Basic) op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
Poll Retrieves data from polled objects on a Microsoft® DirectInput® device. If the device does not require polling, calling this method has no effect. If a device that requires polling is not polled periodically, no new data is received from the device. Calling this method causes Microsoft® DirectInput® to update the device state, generate input events (if buffered data is enabled), and set notification events (if notification is enabled).
RunControlPanel Runs the Microsoft® DirectInput® control panel associated with this device. If the device does not have a control panel associated with it, the default device control panel is launched.
SendForceFeedbackCommand Sends a command to the device's force-feedback system.
SendHardwareCommand Sends a hardware-specific command to the force-feedback driver.
SetActionMap Sets the data format for a device and maps application-defined actions to device objects. It also sets the buffer size for buffered data.
SetCooperativeLevel Establishes the cooperative level for this instance of the device. The cooperative level determines how this instance of the device interacts with other instances of the device and the rest of the system.
SetDataFormat Sets the data format for the Microsoft® DirectInput® device.
SetEventNotification Specifies an event that is to be set when the device state changes. It is also used to turn off event notification.
Unacquire Releases access to the device.
WriteEffect Saves information about one or more force-feedback effects to a file that can be read by using Inputdevice9Enumeffectsinfile. This method is chiefly of interest to those wanting to write their own force-authoring applications.


Property Description
Caps Obtains the capabilities of the DirectInputDevice object.
CreatedEffects Enumerates all the currently created effects for this device. Effects created by Inputdevice9Createeffect are enumerated.
CurrentJoystickState Retrieves immediate data from the joystick device.
CurrentMouseState Retrieves immediate data from the mouse device.
DeviceInformation Obtains information about the device's identity.
ForceFeedbackState Retrieves the state of the device's force-feedback system.
ImageInformation Retrieves information about a device image for use in a configuration property sheet.
Objects Enumerates the input and output objects available on a device.
Properties Retrieves information about the input device.

Inheritance Hierarchy

ObjectLeave Site

MarshalByRefObjectLeave Site


Class Information

Namespace Microsoft.DirectX.DirectInput
Assembly Microsoft.DirectX.DirectInput (microsoft.directx.directinput.dll)
Strong Name Microsoft.DirectX.DirectInput,  Version=1.0.900.0,  Culture=neutral,  PublicKeyToken=d3231b57b74a1492