DIDEVICEOBJECTDATA

The DIDEVICEOBJECTDATA structure contains raw buffered device information. This structure is used with the IDirectInputDevice::GetDeviceData and IDirectInputDevice2::SendDeviceData methods.

typedef struct DIDEVICEOBJECTDATA {

DWORD dwOfs;

DWORD dwData;

DWORD dwTimeStamp;

DWORD dwSequence;

} DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA;

typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;

Members

dwOfs

For GetDeviceData, the offset into the current data format of the object whose data is being reported; that is, the location where the dwData would have been stored if the data had been obtained by a call to the IDirectInputDevice::GetDeviceState method. If the device is accessed as a mouse, keyboard, or joystick, the dwOfs member will be one of the mouse device constants, keyboard device constants, or joystick device constants. If a custom data format has been set, then it will be an offset relative to the custom data format.

For SendDeviceData, the instance ID of the object to which the data is being sent, as obtained from the dwType member of a DIDEVICEOBJECTINSTANCE structure.

dwData

Data obtained from or sent to the device.

For axis input, if the device is in relative axis mode, then the relative axis motion is reported. If the device is in absolute axis mode, then the absolute axis coordinate is reported.

For button input, only the low byte of dwData is significant. The high bit of the low byte is set if the button went down; it is clear if the button went up.

dwTimeStamp

Tick count at which the input event was generated, in milliseconds. The current system tick count can be obtained by calling the Win32 GetTickCount function. Remember that this value wraps around approximately every 50 days.

When the structure is used with the SendDeviceData method, this member must be zero.

dwSequence

DirectInput sequence number for this event. All input events are assigned an increasing sequence number. This allows events from different devices to be sorted chronologically. Since this value can wrap around, care must be taken when comparing two sequence numbers. The DISEQUENCE_COMPARE macro can be used to perform this comparison safely.

When the structure is used with the SendDeviceData method, this member must be zero.

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Use Windows 95 OSR2 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in dinput.h.