DIMOUSESTATE

The DIMOUSESTATE structure contains information about the state of a mouse device or another device that is being accessed as if it were a mouse device. This structure is used with the IDirectInputDevice::GetDeviceState method.

typedef struct { 
    LONG lX; 
    LONG lY; 
    LONG lZ; 
    BYTE rgbButtons[4]; 
} DIMOUSESTATE, *LPDIMOUSESTATE; 
 

Members

lX
Information about the mouse x-axis.
lY
Information about the mouse y-axis.
lZ
Information about the mouse z-axis (typically a wheel). If the mouse does not have a z-axis, then the value is zero.
rgbButtons[4]
Array of button states. The high-order bit of the byte is set if the corresponding button is down.

Remarks

You must prepare the device for mouse-style access by calling the IDirectInputDevice::SetDataFormat method, passing the c_dfDIMouse global data format variable.

The mouse is a relative-axis device, so the absolute axis positions for mouse axes are simply accumulated relative motion. As a result, the value of the absolute axis position is not meaningful except in comparison with other absolute axis positions.

If an axis is in relative mode, then the appropriate member contains the change in position. If it is in absolute mode, then the member contains the absolute axis position.

QuickInfo

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