Show / Hide Table of Contents

# 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)

Control keys are the values between 1 and 26 corresponding to Control-A to Control-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
--- | ---
AltMask | When this value is set, the Key encodes the sequence Alt-KeyValue. And the actual value must be extracted by removing the AltMask.
Backspace | Backspace key.
BackTab | Shift-tab key (backwards tab key).
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.
ControlA | The key code for the user pressing Control-A
ControlB | The key code for the user pressing Control-B
ControlC | The key code for the user pressing Control-C
ControlD | The key code for the user pressing Control-D
ControlE | The key code for the user pressing Control-E
ControlF | The key code for the user pressing Control-F
ControlG | The key code for the user pressing Control-G
ControlH | The key code for the user pressing Control-H
ControlI | The key code for the user pressing Control-I (same as the tab key).
ControlJ | The key code for the user pressing Control-J
ControlK | The key code for the user pressing Control-K
ControlL | The key code for the user pressing Control-L
ControlM | The key code for the user pressing Control-M
ControlN | The key code for the user pressing Control-N (same as the return key).
ControlO | The key code for the user pressing Control-O
ControlP | The key code for the user pressing Control-P
ControlQ | The key code for the user pressing Control-Q
ControlR | The key code for the user pressing Control-R
ControlS | The key code for the user pressing Control-S
ControlSpace | The key code for the user pressing Control-spacebar
ControlT | The key code for the user pressing Control-T
ControlU | The key code for the user pressing Control-U
ControlV | The key code for the user pressing Control-V
ControlW | The key code for the user pressing Control-W
ControlX | The key code for the user pressing Control-X
ControlY | The key code for the user pressing Control-Y
ControlZ | The key code for the user pressing Control-Z
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
Delete | The key code for the user pressing the delete key.
DeleteChar | Delete character key
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
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.
Home | Home key
InsertChar | Insert character key
PageDown | Page Down key.
PageUp | Page Up key.
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).
Tab | The key code for the user pressing the tab key (forwards tab key).
Unknown | A key with an unknown mapping was raised.