RAWINPUT structure (winuser.h)

Contains the raw input from a device.

Syntax

typedef struct tagRAWINPUT {
  RAWINPUTHEADER header;
  union {
    RAWMOUSE    mouse;
    RAWKEYBOARD keyboard;
    RAWHID      hid;
  } data;
} RAWINPUT, *PRAWINPUT, *LPRAWINPUT;

Members

header

Type: RAWINPUTHEADER

The raw input data.

data

data.mouse

Type: RAWMOUSE

If the data comes from a mouse, this is the raw input data.

data.keyboard

Type: RAWKEYBOARD

If the data comes from a keyboard, this is the raw input data.

data.hid

Type: RAWHID

If the data comes from an HID, this is the raw input data.

Remarks

The handle to this structure is passed in the lParam parameter of WM_INPUT.

To get detailed information -- such as the header and the content of the raw input -- call GetRawInputData.

To read the RAWINPUT in the message loop as a buffered read, call GetRawInputBuffer.

To get device specific information, call GetRawInputDeviceInfo with the hDevice from RAWINPUTHEADER.

Raw input is available only when the application calls RegisterRawInputDevices with valid device specifications.

Requirements

Requirement Value
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

GetRawInputBuffer

GetRawInputData

RAWHID

RAWINPUTHEADER

RAWKEYBOARD

RAWMOUSE

Raw Input

Reference