RAWMOUSE structure

Contains information about the state of the mouse.

Syntax

typedef struct tagRAWMOUSE {
  USHORT usFlags;
  union {
    ULONG ulButtons;
    struct {
      USHORT usButtonFlags;
      USHORT usButtonData;
    } DUMMYSTRUCTNAME;
  } DUMMYUNIONNAME;
  ULONG  ulRawButtons;
  LONG   lLastX;
  LONG   lLastY;
  ULONG  ulExtraInformation;
} RAWMOUSE, *PRAWMOUSE, *LPRAWMOUSE;

Members

usFlags

Type: USHORT

The mouse state. This member can be any reasonable combination of the following.

Value Meaning
MOUSE_ATTRIBUTES_CHANGED
0x04
Mouse attributes changed; application needs to query the mouse attributes.
MOUSE_MOVE_RELATIVE
0
Mouse movement data is relative to the last mouse position.
MOUSE_MOVE_ABSOLUTE
1
Mouse movement data is based on absolute position.
MOUSE_VIRTUAL_DESKTOP
0x02
Mouse coordinates are mapped to the virtual desktop (for a multiple monitor system).

DUMMYUNIONNAME

DUMMYUNIONNAME.ulButtons

Type: ULONG

Reserved.

DUMMYUNIONNAME.DUMMYSTRUCTNAME

DUMMYUNIONNAME.DUMMYSTRUCTNAME.usButtonFlags

Type: USHORT

The transition state of the mouse buttons. This member can be one or more of the following values.

Value Meaning
RI_MOUSE_LEFT_BUTTON_DOWN
0x0001
Left button changed to down.
RI_MOUSE_LEFT_BUTTON_UP
0x0002
Left button changed to up.
RI_MOUSE_MIDDLE_BUTTON_DOWN
0x0010
Middle button changed to down.
RI_MOUSE_MIDDLE_BUTTON_UP
0x0020
Middle button changed to up.
RI_MOUSE_RIGHT_BUTTON_DOWN
0x0004
Right button changed to down.
RI_MOUSE_RIGHT_BUTTON_UP
0x0008
Right button changed to up.
RI_MOUSE_BUTTON_1_DOWN
0x0001
RI_MOUSE_LEFT_BUTTON_DOWN
RI_MOUSE_BUTTON_1_UP
0x0002
RI_MOUSE_LEFT_BUTTON_UP
RI_MOUSE_BUTTON_2_DOWN
0x0004
RI_MOUSE_RIGHT_BUTTON_DOWN
RI_MOUSE_BUTTON_2_UP
0x0008
RI_MOUSE_RIGHT_BUTTON_UP
RI_MOUSE_BUTTON_3_DOWN
0x0010
RI_MOUSE_MIDDLE_BUTTON_DOWN
RI_MOUSE_BUTTON_3_UP
0x0020
RI_MOUSE_MIDDLE_BUTTON_UP
RI_MOUSE_BUTTON_4_DOWN
0x0040
XBUTTON1 changed to down.
RI_MOUSE_BUTTON_4_UP
0x0080
XBUTTON1 changed to up.
RI_MOUSE_BUTTON_5_DOWN
0x100
XBUTTON2 changed to down.
RI_MOUSE_BUTTON_5_UP
0x0200
XBUTTON2 changed to up.
RI_MOUSE_WHEEL
0x0400
Raw input comes from a mouse wheel. The wheel delta is stored in usButtonData.

DUMMYUNIONNAME.DUMMYSTRUCTNAME.usButtonData

Type: USHORT

If usButtonFlags is RI_MOUSE_WHEEL, this member is a signed value that specifies the wheel delta.

ulRawButtons

Type: ULONG

The raw state of the mouse buttons.

lLastX

Type: LONG

The motion in the X direction. This is signed relative motion or absolute motion, depending on the value of usFlags.

lLastY

Type: LONG

The motion in the Y direction. This is signed relative motion or absolute motion, depending on the value of usFlags.

ulExtraInformation

Type: ULONG

The device-specific additional information for the event.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header winuser.h (include Windows.h)

See also

Conceptual

GetRawInputDeviceInfo

RAWINPUT

Raw Input

Reference