please dont rip this site Prev Next

KEY_EVENT_RECORD info  Overview  Group

The KEY_EVENT_RECORD structure is used to report keyboard input events in a console INPUT_RECORD structure.

typedef struct _KEY_EVENT_RECORD { // ker 

    BOOL bKeyDown; 

    WORD wRepeatCount; 

    WORD wVirtualKeyCode; 

    WORD wVirtualScanCode; 

    union { 

        WCHAR UnicodeChar; 

        CHAR  AsciiChar; 

    } uChar; 

    DWORD dwControlKeyState; 




Specifies TRUE if the key is being pressed, FALSE if the key is being released.
Specifies a count indicating 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.
Specifies the virtual-key code that identifies the given key in a device-independent manner.
Specifies the virtual scan code of the given key that represents the device-dependent value generated by the keyboard hardware.
Specifies the translated Unicode or ASCII character, depending on whether the wide-character (Unicode) or ANSI version of the ReadConsoleInput function was used.
Indicates the state of the control keys. This member can be a combination of the following values:




The CAPS LOCK light is on.


The key is enhanced.


The left ALT key is pressed.


The left CTRL key is pressed.


The NUM LOCK light is on.


The right ALT key is pressed.


The right CTRL key is pressed.


The SCROLL LOCK light is on.


The SHIFT key is pressed.


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 Windows 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).

See Also

PeekConsoleInput, ReadConsoleInput, WriteConsoleInput, INPUT_RECORD

See also:

file: /Techref/os/win/api/win32/struc/src/str09_20.htm, 5KB, , updated: 2000/4/7 12:20, local time: 2022/5/22 13:29,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!


After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220522
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!