IDirectInputDevice

Applications use the methods of the IDirectInputDevice interface to gain and release access to DirectInput devices, manage device properties and information, set behavior, perform initialization, and invoke a device's control panel. The IDirectInputDevice2 interface adds force feedback capabilities and support for polled devices.

The IDirectInputDevice interface is obtained by using the IDirectInput::CreateDevice method. The IDirectInputDevice2 interface is obtained by calling the IDirectInputDevice::QueryInterface method; for an example, see Creating a DirectInput Device.

This section is a reference to the methods of these interfaces.

The methods of the IDirectInputDevice interface can be organized into the following groups.

Accessing input devices Acquire
Unacquire
Device information GetCapabilities
GetDeviceData
GetDeviceInfo
GetDeviceState
SetDataFormat
SetEventNotification
Device objects EnumObjects
GetObjectInfo
Device properties GetProperty
SetProperty
Setting behavior SetCooperativeLevel
Miscellaneous Initialize
RunControlPanel

The IDirectInputDevice interface, like all COM interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:

AddRef
QueryInterface
Release

The IDirectInputDevice2 interface supports all the above methods as well as the following additional methods:

CreateEffect
EnumCreatedEffectObjects
EnumEffects
Escape
GetEffectInfo
GetForceFeedbackState
Poll
SendDeviceData
SendForceFeedbackCommand

The LPDIRECTINPUTDEVICE and LPDIRECTINPUTDEVICE2 types are defined as pointers to the IDirectInput interface:

typedef struct IDirectInputDevice    *LPDIRECTINPUTDEVICE;
typedef struct IDirectInputDevice2   *LPDIRECTINPUTDEVICE2;