Enum Key
The Key enumeration contains special encoding for some keys, but can also
encode all the unicode values that can be passed.
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
[Flags]
public enum Key : uint
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).
Fields
Name | Description |
---|---|
A | The key code for the user pressing Shift-A |
AltMask | When this value is set, the Key encodes the sequence Alt-KeyValue. And the actual value must be extracted by removing the AltMask. |
B | The key code for the user pressing Shift-B |
Backspace | Backspace key. |
BackTab | Shift-tab key (backwards tab key). |
C | The key code for the user pressing Shift-C |
CharMask | Mask 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. |
CtrlMask | When this value is set, the Key encodes the sequence Ctrl-KeyValue. And the actual value must be extracted by removing the CtrlMask. |
CursorDown | Cursor down key. |
CursorLeft | Cursor left key. |
CursorRight | Cursor right key. |
CursorUp | Cursor up key |
D | The key code for the user pressing Shift-D |
D0 | Digit 0. |
D1 | Digit 1. |
D2 | Digit 2. |
D3 | Digit 3. |
D4 | Digit 4. |
D5 | Digit 5. |
D6 | Digit 6. |
D7 | Digit 7. |
D8 | Digit 8. |
D9 | Digit 9. |
Delete | The key code for the user pressing the delete key. |
DeleteChar | Delete character key |
E | The key code for the user pressing Shift-E |
End | End key |
Enter | The key code for the user pressing the return key. |
Esc | The key code for the user pressing the escape key |
F | The key code for the user pressing Shift-F |
F1 | F1 key. |
F10 | F10 key. |
F11 | F11 key. |
F12 | F12 key. |
F2 | F2 key. |
F3 | F3 key. |
F4 | F4 key. |
F5 | F5 key. |
F6 | F6 key. |
F7 | F7 key. |
F8 | F8 key. |
F9 | F9 key. |
G | The key code for the user pressing Shift-G |
H | The key code for the user pressing Shift-H |
Home | Home key |
I | The key code for the user pressing Shift-I |
InsertChar | Insert character key |
J | The key code for the user pressing Shift-J |
K | The key code for the user pressing Shift-K |
L | The key code for the user pressing Shift-L |
M | The key code for the user pressing Shift-M |
N | The key code for the user pressing Shift-N |
Null | The key code representing null or empty |
O | The key code for the user pressing Shift-O |
P | The key code for the user pressing Shift-P |
PageDown | Page Down key. |
PageUp | Page Up key. |
Q | The key code for the user pressing Shift-Q |
R | The key code for the user pressing Shift-R |
S | The key code for the user pressing Shift-S |
ShiftMask | When this value is set, the Key encodes the sequence Shift-KeyValue. |
Space | The key code for the user pressing the space bar |
SpecialMask | 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). |
T | The key code for the user pressing Shift-T |
Tab | The key code for the user pressing the tab key (forwards tab key). |
U | The key code for the user pressing Shift-U |
Unknown | A key with an unknown mapping was raised. |
V | The key code for the user pressing Shift-V |
W | The key code for the user pressing Shift-W |
X | The key code for the user pressing Shift-X |
Y | The key code for the user pressing Shift-Y |
Z | The key code for the user pressing Shift-Z |