Applies to: desktop apps only
Describes a keyboard input event in a console INPUT_RECORD structure.
Syntax
typedef struct _KEY_EVENT_RECORD {
BOOL bKeyDown;
WORD wRepeatCount;
WORD wVirtualKeyCode;
WORD wVirtualScanCode;
union {
WCHAR UnicodeChar;
CHAR AsciiChar;
} uChar;
DWORD dwControlKeyState;
} KEY_EVENT_RECORD;
Members
- bKeyDown
-
If the key is pressed, this member is TRUE. Otherwise, this member is FALSE (the key is released).
- wRepeatCount
-
The repeat count, which indicates that a key is being held down. For example, when a key is held down, you might get five events with this member equal to 1, one event with this member equal to 5, or multiple events with this member greater than or equal to 1.
- wVirtualKeyCode
-
A virtual-key code that identifies the given key in a device-independent manner.
- wVirtualScanCode
-
The virtual scan code of the given key that represents the device-dependent value generated by the keyboard hardware.
- uChar
-
A union of the following members.
- UnicodeChar
-
Translated Unicode character.
- AsciiChar
-
Translated ASCII character.
- dwControlKeyState
-
The state of the control keys. This member can be one or more of the following values.
Remarks
Enhanced keys for the IBM® 101- and 102-key keyboards are the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and direction keys in the clusters to the left of the keypad; and the divide (/) and ENTER keys in the keypad.
Keyboard input events are generated when any key, including control keys, is pressed or released. However, the ALT key when pressed and released without combining with another character, has special meaning to the system and is not passed through to the application. Also, the CTRL+C key combination is not passed through if the input handle is in processed mode (ENABLE_PROCESSED_INPUT).
Examples
For an example, see Reading Input Buffer Events.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
See also
Send comments about this topic to Microsoft
Build date: 5/5/2012
