RAWKEYBOARD structure (winuser.h)

Contains information about the state of the keyboard.

Syntax

typedef struct tagRAWKEYBOARD {
  USHORT MakeCode;
  USHORT Flags;
  USHORT Reserved;
  USHORT VKey;
  UINT   Message;
  ULONG  ExtraInformation;
} RAWKEYBOARD, *PRAWKEYBOARD, *LPRAWKEYBOARD;

Members

MakeCode

Type: USHORT

Specifies the scan code (from Scan Code Set 1) associated with a key press. See Remarks.

Flags

Type: USHORT

Flags for scan code information. It can be one or more of the following:

Value Meaning
RI_KEY_MAKE 0 The key is down.
RI_KEY_BREAK 1 The key is up.
RI_KEY_E0 2 The scan code has the E0 prefix.
RI_KEY_E1 4 The scan code has the E1 prefix.

Reserved

Type: USHORT

Reserved; must be zero.

VKey

Type: USHORT

The corresponding legacy virtual-key code.

Message

Type: UINT

The corresponding legacy keyboard window message, for example WM_KEYDOWN, WM_SYSKEYDOWN, and so forth.

ExtraInformation

Type: ULONG

The device-specific additional information for the event.

Remarks

For a MakeCode value HID client mapper driver converts HID usages into scan codes according to USB HID to PS/2 Scan Code Translation Table (see PS/2 Set 1 Make column).

Older PS/2 keyboards actually transmit Scan Code Set 2 values down the wire from the keyboard to the keyboard port. These values are translated to Scan Code Set 1 by the i8042 port chip. Possible values are listed in Keyboard Scan Code Specification (see Scan Code Table).

KEYBOARD_OVERRUN_MAKE_CODE is a special MakeCode value sent when an invalid or unrecognizable combination of keys is pressed or the number of keys pressed exceeds the limit for this keyboard.

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

Keyboard and mouse HID client drivers

Reference

USB HID to PS/2 Scan Code Translation Table

PS/2 Keyboard Scan Code Specification

KEYBOARD_INPUT_DATA structure