Class Key
The Key enumeration contains special encoding for some keys, but can also
encode all the unicode values that can be passed.
Inheritance
System.Object
Key
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).
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public sealed class Key : Enum
Fields
a
Declaration
public const Key a
Field Value
Type | Description |
---|---|
Key |
A
The key code for the user pressing A
Declaration
public const Key A
Field Value
Type | Description |
---|---|
Key |
AltMask
When this value is set, the Key encodes the sequence Alt-KeyValue.
And the actual value must be extracted by removing the AltMask.
Declaration
public const Key AltMask
Field Value
Type | Description |
---|---|
Key |
b
Declaration
public const Key b
Field Value
Type | Description |
---|---|
Key |
B
The key code for the user pressing B
Declaration
public const Key B
Field Value
Type | Description |
---|---|
Key |
Backspace
Backspace key.
Declaration
public const Key Backspace
Field Value
Type | Description |
---|---|
Key |
BackTab
Shift-tab key (backwards tab key).
Declaration
public const Key BackTab
Field Value
Type | Description |
---|---|
Key |
c
Declaration
public const Key c
Field Value
Type | Description |
---|---|
Key |
C
The key code for the user pressing C
Declaration
public const Key C
Field Value
Type | Description |
---|---|
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.
Declaration
public const Key CharMask
Field Value
Type | Description |
---|---|
Key |
CtrlMask
When this value is set, the Key encodes the sequence Ctrl-KeyValue.
And the actual value must be extracted by removing the CtrlMask.
Declaration
public const Key CtrlMask
Field Value
Type | Description |
---|---|
Key |
CursorDown
Cursor down key.
Declaration
public const Key CursorDown
Field Value
Type | Description |
---|---|
Key |
CursorLeft
Cursor left key.
Declaration
public const Key CursorLeft
Field Value
Type | Description |
---|---|
Key |
CursorRight
Cursor right key.
Declaration
public const Key CursorRight
Field Value
Type | Description |
---|---|
Key |
CursorUp
Cursor up key
Declaration
public const Key CursorUp
Field Value
Type | Description |
---|---|
Key |
d
Declaration
public const Key d
Field Value
Type | Description |
---|---|
Key |
D
The key code for the user pressing D
Declaration
public const Key D
Field Value
Type | Description |
---|---|
Key |
D0
Digit 0.
Declaration
public const Key D0
Field Value
Type | Description |
---|---|
Key |
D1
Digit 1.
Declaration
public const Key D1
Field Value
Type | Description |
---|---|
Key |
D2
Digit 2.
Declaration
public const Key D2
Field Value
Type | Description |
---|---|
Key |
D3
Digit 3.
Declaration
public const Key D3
Field Value
Type | Description |
---|---|
Key |
D4
Digit 4.
Declaration
public const Key D4
Field Value
Type | Description |
---|---|
Key |
D5
Digit 5.
Declaration
public const Key D5
Field Value
Type | Description |
---|---|
Key |
D6
Digit 6.
Declaration
public const Key D6
Field Value
Type | Description |
---|---|
Key |
D7
Digit 7.
Declaration
public const Key D7
Field Value
Type | Description |
---|---|
Key |
D8
Digit 8.
Declaration
public const Key D8
Field Value
Type | Description |
---|---|
Key |
D9
Digit 9.
Declaration
public const Key D9
Field Value
Type | Description |
---|---|
Key |
Delete
The key code for the user pressing the delete key.
Declaration
public const Key Delete
Field Value
Type | Description |
---|---|
Key |
DeleteChar
Delete character key
Declaration
public const Key DeleteChar
Field Value
Type | Description |
---|---|
Key |
e
Declaration
public const Key e
Field Value
Type | Description |
---|---|
Key |
E
The key code for the user pressing E
Declaration
public const Key E
Field Value
Type | Description |
---|---|
Key |
End
End key
Declaration
public const Key End
Field Value
Type | Description |
---|---|
Key |
Enter
The key code for the user pressing the return key.
Declaration
public const Key Enter
Field Value
Type | Description |
---|---|
Key |
Esc
The key code for the user pressing the escape key
Declaration
public const Key Esc
Field Value
Type | Description |
---|---|
Key |
f
Declaration
public const Key f
Field Value
Type | Description |
---|---|
Key |
F
The key code for the user pressing F
Declaration
public const Key F
Field Value
Type | Description |
---|---|
Key |
F1
F1 key.
Declaration
public const Key F1
Field Value
Type | Description |
---|---|
Key |
F10
F10 key.
Declaration
public const Key F10
Field Value
Type | Description |
---|---|
Key |
F11
F11 key.
Declaration
public const Key F11
Field Value
Type | Description |
---|---|
Key |
F12
F12 key.
Declaration
public const Key F12
Field Value
Type | Description |
---|---|
Key |
F2
F2 key.
Declaration
public const Key F2
Field Value
Type | Description |
---|---|
Key |
F3
F3 key.
Declaration
public const Key F3
Field Value
Type | Description |
---|---|
Key |
F4
F4 key.
Declaration
public const Key F4
Field Value
Type | Description |
---|---|
Key |
F5
F5 key.
Declaration
public const Key F5
Field Value
Type | Description |
---|---|
Key |
F6
F6 key.
Declaration
public const Key F6
Field Value
Type | Description |
---|---|
Key |
F7
F7 key.
Declaration
public const Key F7
Field Value
Type | Description |
---|---|
Key |
F8
F8 key.
Declaration
public const Key F8
Field Value
Type | Description |
---|---|
Key |
F9
F9 key.
Declaration
public const Key F9
Field Value
Type | Description |
---|---|
Key |
g
Declaration
public const Key g
Field Value
Type | Description |
---|---|
Key |
G
The key code for the user pressing G
Declaration
public const Key G
Field Value
Type | Description |
---|---|
Key |
h
Declaration
public const Key h
Field Value
Type | Description |
---|---|
Key |
H
The key code for the user pressing H
Declaration
public const Key H
Field Value
Type | Description |
---|---|
Key |
Home
Home key
Declaration
public const Key Home
Field Value
Type | Description |
---|---|
Key |
i
Declaration
public const Key i
Field Value
Type | Description |
---|---|
Key |
I
The key code for the user pressing I
Declaration
public const Key I
Field Value
Type | Description |
---|---|
Key |
InsertChar
Insert character key
Declaration
public const Key InsertChar
Field Value
Type | Description |
---|---|
Key |
j
Declaration
public const Key j
Field Value
Type | Description |
---|---|
Key |
J
The key code for the user pressing J
Declaration
public const Key J
Field Value
Type | Description |
---|---|
Key |
k
Declaration
public const Key k
Field Value
Type | Description |
---|---|
Key |
K
The key code for the user pressing K
Declaration
public const Key K
Field Value
Type | Description |
---|---|
Key |
l
Declaration
public const Key l
Field Value
Type | Description |
---|---|
Key |
L
The key code for the user pressing L
Declaration
public const Key L
Field Value
Type | Description |
---|---|
Key |
m
Declaration
public const Key m
Field Value
Type | Description |
---|---|
Key |
M
The key code for the user pressing M
Declaration
public const Key M
Field Value
Type | Description |
---|---|
Key |
n
Declaration
public const Key n
Field Value
Type | Description |
---|---|
Key |
N
The key code for the user pressing N
Declaration
public const Key N
Field Value
Type | Description |
---|---|
Key |
Null
The key code representing null or empty
Declaration
public const Key Null
Field Value
Type | Description |
---|---|
Key |
o
Declaration
public const Key o
Field Value
Type | Description |
---|---|
Key |
O
The key code for the user pressing O
Declaration
public const Key O
Field Value
Type | Description |
---|---|
Key |
p
Declaration
public const Key p
Field Value
Type | Description |
---|---|
Key |
P
The key code for the user pressing P
Declaration
public const Key P
Field Value
Type | Description |
---|---|
Key |
PageDown
Page Down key.
Declaration
public const Key PageDown
Field Value
Type | Description |
---|---|
Key |
PageUp
Page Up key.
Declaration
public const Key PageUp
Field Value
Type | Description |
---|---|
Key |
q
Declaration
public const Key q
Field Value
Type | Description |
---|---|
Key |
Q
The key code for the user pressing Q
Declaration
public const Key Q
Field Value
Type | Description |
---|---|
Key |
r
Declaration
public const Key r
Field Value
Type | Description |
---|---|
Key |
R
The key code for the user pressing R
Declaration
public const Key R
Field Value
Type | Description |
---|---|
Key |
s
Declaration
public const Key s
Field Value
Type | Description |
---|---|
Key |
S
The key code for the user pressing S
Declaration
public const Key S
Field Value
Type | Description |
---|---|
Key |
ShiftMask
When this value is set, the Key encodes the sequence Shift-KeyValue.
Declaration
public const Key ShiftMask
Field Value
Type | Description |
---|---|
Key |
Space
The key code for the user pressing the space bar
Declaration
public const Key Space
Field Value
Type | Description |
---|---|
Key |
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).
Declaration
public const Key SpecialMask
Field Value
Type | Description |
---|---|
Key |
t
Declaration
public const Key t
Field Value
Type | Description |
---|---|
Key |
T
The key code for the user pressing T
Declaration
public const Key T
Field Value
Type | Description |
---|---|
Key |
Tab
The key code for the user pressing the tab key (forwards tab key).
Declaration
public const Key Tab
Field Value
Type | Description |
---|---|
Key |
u
Declaration
public const Key u
Field Value
Type | Description |
---|---|
Key |
U
The key code for the user pressing U
Declaration
public const Key U
Field Value
Type | Description |
---|---|
Key |
Unknown
A key with an unknown mapping was raised.
Declaration
public const Key Unknown
Field Value
Type | Description |
---|---|
Key |
v
Declaration
public const Key v
Field Value
Type | Description |
---|---|
Key |
V
The key code for the user pressing V
Declaration
public const Key V
Field Value
Type | Description |
---|---|
Key |
value__
Declaration
public uint value__
Field Value
Type | Description |
---|---|
System.UInt32 |
w
Declaration
public const Key w
Field Value
Type | Description |
---|---|
Key |
W
The key code for the user pressing W
Declaration
public const Key W
Field Value
Type | Description |
---|---|
Key |
x
Declaration
public const Key x
Field Value
Type | Description |
---|---|
Key |
X
The key code for the user pressing X
Declaration
public const Key X
Field Value
Type | Description |
---|---|
Key |
y
Declaration
public const Key y
Field Value
Type | Description |
---|---|
Key |
Y
The key code for the user pressing Y
Declaration
public const Key Y
Field Value
Type | Description |
---|---|
Key |
z
Declaration
public const Key z
Field Value
Type | Description |
---|---|
Key |
Z
The key code for the user pressing Z
Declaration
public const Key Z
Field Value
Type | Description |
---|---|
Key |