Platform SDK: DirectX

DIDEVICEOBJECTDATA

The DIDEVICEOBJECTDATA structure contains raw buffered device information. This structure is used with the IDirectInputDevice7::GetDeviceData and the IDirectInputDevice7::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 in which the dwData would have been stored if the data had been obtained by a call to the IDirectInputDevice7::GetDeviceState method. If the device is accessed as a mouse, keyboard, or joystick, the dwOfs member is one of the mouse device constants, keyboard device constants, or joystick device constants. If a custom data format has been set, it is 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, the relative axis motion is reported. If the device is in absolute axis mode, 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 (at a lower resolution) can be obtained by calling the Win32 GetTickCount function. This value wraps around approximately every 50 days.

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

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 0.

Requirements

  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.