key.exe
Key provides the user with information about a particular key input event. The user may type in as many keys or key combinations as desired. To quit, the user must press q. The user types a key or several keys simultaneously and sees the following result:
{KeyDown, RepeatCount, VirtualKeyCode, VirtualScanCode, Char, ControlKeyState, Character}
KeyDown
Specifies 1 if the key is being pressed, 0 if the key is being released,
RepeatCount
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.
VirtualKeyCode
Specifies the virtual-key code that identifies the given key in a device-independent manner.
VirtualScanCode
Specifies the virtual scan code of the given key that represents the device-dependent value generated by the keyboard hardware.
Char
Specifies the translated ASCII character in hexadecimal
ControlKeyState
Indicates the state of the control keys. This member can be a combination of the following values:
Value Meaning
0x0001 The right ALT key is pressed.
0x0002 The left ALT key is pressed.
0x0004 The right CTRL key is pressed.
0x0008 The left CTRL key is pressed.
0x0010 The SHIFT key is pressed.
0x0020 The NUM LOCK light is on.
0x0040 The SCROLL LOCK light is on.
0x0080 The CAPS LOCK light is on.
0x0100 The key is enhanced.
Character
Actual display character. May be a non-text character.
USAGE:
key [/?] NOTE: press q to exit key program
COMMAND OPTIONS:
/? Displays text help file
EXAMPLES:
To see input value for different keys, first type key and then [ENTER]:
examples:
type: <left-ctrl> c
results: RECORD = {1, 1, 11, 1d, 0, 8, }
RECORD = {1, 1, 43, 2e, 3, 8, non-text char}
RECORD = {0, 1, 43, 2e, 3, 8, non-text char}
RECORD = {0, 1, 11, 1d, 0, 0, }
type: shift r
results: RECORD = {1, 1, 10, 2a, 0, 10, }
RECORD = {1, 1, 52, 13, 52, 10, R}
RECORD = {0, 1, 52, 13, 52, 10, R}
RECORD = {0, 1, 10, 2a, 0, 0, }
type: r
results: RECORD = {1, 1, 52, 13, 72, 0, r}
RECORD = {0, 1, 52, 13, 72, 0, r}
type: space bar
results: RECORD = {1, 1, 20, 39, 20, 0, }
RECORD = {0, 1, 20, 39, 20, 0, }
type q to exit program.