Platform SDK: DirectX

DirectInputDevice.SetDataFormat

The DirectInputDevice.SetDataFormat method sets the data format for a DirectInput device that is not a standard keyboard, mouse, or keyboard.

object.SetDataFormat(format As DIDATAFORMAT, _
  formatArray() As DIOBJECTDATAFORMAT))

Parameters

object
Object expression that resolves to a DirectInputDevice object.
format
A DIDATAFORMAT type that describes the format of the data the device should return.
formatArray
Array of DIOBJECTDATAFORMAT types describing data formats for objects on the device.

Error Codes

If the method fails, an error is raised and Err.Number may be one of the following error codes:

DIERR_ACQUIRED
DIERR_INVALIDPARAM

Remarks

The data format must be set before the device can be acquired by using the DirectInputDevice.Acquire method. It is necessary to set the data format only once. The data format cannot be changed while the device is acquired.

See Also

DirectInputDevice.SetCommonDataFormat