Device Setup

Your application must obtain a COM interface for each device from which it expects input. It must also prepare each device for use, which requires, at the very least, setting the data format and acquiring the device. You may also wish to carry out other preparatory tasks such as getting information about the devices and changing their properties.

The following tasks are part of the setup process. Certain steps are always required; others may only be necessary if you need further information about devices or need to change default values.

·Create the DirectInput device (required). See Creating a DirectInput Device.

·Get the device capabilities (optional).

·Enumerate the keys, buttons, and axes on the device (optional). See Device Object Enumeration.

·Set the cooperative level (recommended).

·Set the data format (required).

·Set the device properties (optional).

·When ready to read data, acquire the device (required). See Acquiring Devices.