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 IDirectInputDevice interface is obtained by using the IDirectInput::CreateDevice method. For an example, see Creating a DirectInput Device.
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:
| IUnknown | AddRef |
| QueryInterface | |
| Release |
The LPDIRECTINPUTDEVICE type is defined as a pointer to the IDirectInputDevice interface:
typedef struct IDirectInputDevice *LPDIRECTINPUTDEVICE;
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dinput.h.
Import Library: Use dinput.lib.