Enum Key
The Key enumeration contains special encoding for some keys, but can also encode all the unicode values that can be passed.
[Flags]
public enum Key : uint
Fields
A = 65The key code for the user pressing Shift-A
AltMask = 2147483648When this value is set, the Key encodes the sequence Alt-KeyValue. And the actual value must be extracted by removing the AltMask.
B = 66The key code for the user pressing Shift-B
BackTab = 1048586Shift-tab key (backwards tab key).
Backspace = 8Backspace key.
C = 67The key code for the user pressing Shift-C
CharMask = 1048575Mask that indicates that this is a character value, values outside this range indicate special characters like Alt-key combinations or special keys on the keyboard like function keys, arrows keys and so on.
Clear = 12The key code for the user pressing the clear key.
CtrlMask = 1073741824When this value is set, the Key encodes the sequence Ctrl-KeyValue. And the actual value must be extracted by removing the CtrlMask.
CursorDown = 1048577Cursor down key.
CursorLeft = 1048578Cursor left key.
CursorRight = 1048579Cursor right key.
CursorUp = 1048576Cursor up key
D = 68The key code for the user pressing Shift-D
D0 = 48Digit 0.
D1 = 49Digit 1.
D2 = 50Digit 2.
D3 = 51Digit 3.
D4 = 52Digit 4.
D5 = 53Digit 5.
D6 = 54Digit 6.
D7 = 55Digit 7.
D8 = Backspace | D0Digit 8.
D9 = 57Digit 9.
Delete = 127The key code for the user pressing the delete key.
DeleteChar = 1048585Delete character key.
E = 69The key code for the user pressing Shift-E
End = 1048583End key.
Enter = 10The key code for the user pressing the return key.
Esc = 27The key code for the user pressing the escape key
F = 70The key code for the user pressing Shift-F
F1 = 1048588F1 key.
F10 = 1048597F10 key.
F11 = 1048598F11 key.
F12 = 1048599F12 key.
F13 = Backspace | F5F13 key.
F14 = 1048601F14 key.
F15 = 1048602F15 key.
F16 = 1048603F16 key.
F17 = 1048604F17 key.
F18 = 1048605F18 key.
F19 = 1048606F19 key.
F2 = 1048589F2 key.
F20 = 1048607F20 key.
F21 = Space | CursorUpF21 key.
F22 = 1048609F22 key.
F23 = 1048610F23 key.
F24 = 1048611F24 key.
F3 = 1048590F3 key.
F4 = 1048591F4 key.
F5 = 1048592F5 key.
F6 = 1048593F6 key.
F7 = 1048594F7 key.
F8 = 1048595F8 key.
F9 = 1048596F9 key.
G = 71The key code for the user pressing Shift-G
H = 72The key code for the user pressing Shift-H
Home = 1048582Home key.
I = 73The key code for the user pressing Shift-I
InsertChar = Backspace | CursorUpInsert character key.
J = 74The key code for the user pressing Shift-J
K = 75The key code for the user pressing Shift-K
L = 76The key code for the user pressing Shift-L
M = 77The key code for the user pressing Shift-M
N = 78The key code for the user pressing Shift-N
Null = 0The key code representing null or empty
O = 79The key code for the user pressing Shift-O
P = 80The key code for the user pressing Shift-P
PageDown = 1048581Page Down key.
PageUp = 1048580Page Up key.
PrintScreen = 1048587Print screen character key.
Q = 81The key code for the user pressing Shift-Q
R = 82The key code for the user pressing Shift-R
S = 83The key code for the user pressing Shift-S
ShiftMask = 268435456When this value is set, the Key encodes the sequence Shift-KeyValue.
Space = 32The key code for the user pressing the space bar
SpecialMask = 4293918720If the SpecialMask is set, then the value is that of the special mask, otherwise, the value is the one of the lower bits (as extracted by CharMask).
T = 84The key code for the user pressing Shift-T
Tab = 9The key code for the user pressing the tab key (forwards tab key).
U = 85The key code for the user pressing Shift-U
Unknown = 1048612A key with an unknown mapping was raised.
V = 86The key code for the user pressing Shift-V
W = 87The key code for the user pressing Shift-W
X = Backspace | PThe key code for the user pressing Shift-X
Y = 89The key code for the user pressing Shift-Y
Z = 90The key code for the user pressing Shift-Z
a = Space | AThe key code for the user pressing A
b = Space | BThe key code for the user pressing B
c = 99The key code for the user pressing C
d = Space | DThe key code for the user pressing D
e = 101The key code for the user pressing E
f = 102The key code for the user pressing F
g = 103The key code for the user pressing G
h = Space | HThe key code for the user pressing H
i = 105The key code for the user pressing I
j = 106The key code for the user pressing J
k = 107The key code for the user pressing K
l = 108The key code for the user pressing L
m = 109The key code for the user pressing M
n = 110The key code for the user pressing N
o = 111The key code for the user pressing O
p = Space | PThe key code for the user pressing P
q = 113The key code for the user pressing Q
r = 114The key code for the user pressing R
s = 115The key code for the user pressing S
t = 116The key code for the user pressing T
u = 117The key code for the user pressing U
v = 118The key code for the user pressing V
w = 119The key code for the user pressing W
x = Backspace | pThe key code for the user pressing X
y = 121The key code for the user pressing Y
z = 122The key code for the user pressing Z
Remarks
If the SpecialMask is set, then the value is that of the special mask, otherwise, the value is the one of the lower bits (as extracted by CharMask)
Numerics keys are the values between 48 and 57 corresponding to 0 to 9
Upper alpha keys are the values between 65 and 90 corresponding to A to Z
Unicode runes are also stored here, the letter 'A" for example is encoded as a value 65 (not surfaced in the enum).