Applies to: desktop apps only
Contains information about the state of the mouse.
Syntax
typedef struct tagRAWMOUSE {
USHORT usFlags;
union {
ULONG ulButtons;
struct {
USHORT usButtonFlags;
USHORT usButtonData;
};
};
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.
- ulButtons
-
Type: ULONG
-
Reserved.
- usButtonFlags
-
Type: USHORT
-
The transition state of the mouse buttons. This member can be one or more of the following values.
- 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 |
|---|---|
|
Minimum supported server | Windows Server 2003 |
|
Header |
|
See also
- Reference
- GetRawInputDeviceInfo
- RAWINPUT
- Conceptual
- Raw Input
Send comments about this topic to Microsoft
Build date: 3/6/2012
<StructLayout(LayoutKind.Explicit)> _
Public Structure RAWMOUSE
<FieldOffset(0)> Public usFlags As RAWMOUSEFlags
<FieldOffset(2)> Public ulButtons As UInteger
<FieldOffset(4)> Public usButtonFlags As RAWMOUSEButtonFlags
<FieldOffset(2)> Public usButtonData As UShort
<FieldOffset(6)> Public ulRawButtons As UInteger
<FieldOffset(10)> Public lLastX As Integer
<FieldOffset(14)> Public lLastY As Integer
<FieldOffset(18)> Public ulExtraInformation As UInteger
End Structure
$0 $0Note that fields usButtondata and usButtonFlags are physically swapped. I don't know if it is docummentation bug at this page or some little-endian/big-endian issue, but the structure worksa as I've declared it.$0It isn't defined in the 7.1 SDK version of WinUser.h, but from inspection there should also be a:
#define RI_MOUSE_HORIZONTAL_WHEEL 0x0800
The delta value is stored usButtonData in the same fashion as the vertical wheel.
The generic HID mouse driver produces these values as of at least Win 7.