1 out of 3 rated this helpful - Rate this topic

ConsoleKey Enumeration

Note: This enumeration is new in the .NET Framework version 2.0.

Specifies the standard keys on a console.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

[SerializableAttribute] 
public enum ConsoleKey
/** @attribute SerializableAttribute() */ 
public enum ConsoleKey
SerializableAttribute 
public enum ConsoleKey
  Member name Description
A The A key. 
Add The Add key. 
Applications The Application key (Microsoft Natural Keyboard). 
Attention The ATTN key. 
B The B key. 
Backspace The BACKSPACE key. 
BrowserBack The Browser Back key (Windows 2000 or later). 
BrowserFavorites The Browser Favorites key (Windows 2000 or later). 
BrowserForward The Browser Forward key (Windows 2000 or later). 
BrowserHome The Browser Home key (Windows 2000 or later). 
BrowserRefresh The Browser Refresh key (Windows 2000 or later). 
BrowserSearch The Browser Search key (Windows 2000 or later). 
BrowserStop The Browser Stop key (Windows 2000 or later). 
C The C key. 
Clear The CLEAR key. 
CrSel The CRSEL (CURSOR SELECT) key. 
D The D key. 
D0 The 0 key. 
D1 The 1 key. 
D2 The 2 key. 
D3 The 3 key. 
D4 The 4 key. 
D5 The 5 key. 
D6 The 6 key. 
D7 The 7 key. 
D8 The 8 key. 
D9 The 9 key. 
Decimal The Decimal key. 
Delete The DEL (DELETE) key. 
Divide The Divide key. 
DownArrow The DOWN ARROW key. 
E The E key. 
End The END key. 
Enter The ENTER key. 
EraseEndOfFile The ERASE EOF key. 
Escape The ESC (ESCAPE) key. 
Execute The EXECUTE key. 
ExSel The EXSEL (EXTEND SELECTION) key. 
F The F key. 
F1 The F1 key. 
F10 The F10 key. 
F11 The F11 key. 
F12 The F12 key. 
F13 The F13 key. 
F14 The F14 key. 
F15 The F15 key. 
F16 The F16 key. 
F17 The F17 key. 
F18 The F18 key. 
F19 The F19 key. 
F2 The F2 key. 
F20 The F20 key. 
F21 The F21 key. 
F22 The F22 key. 
F23 The F23 key. 
F24 The F24 key. 
F3 The F3 key. 
F4 The F4 key. 
F5 The F5 key. 
F6 The F6 key. 
F7 The F7 key. 
F8 The F8 key. 
F9 The F9 key. 
G The G key. 
H The H key. 
Help The HELP key. 
Home The HOME key. 
I The I key. 
Insert The INS (INSERT) key. 
J The J key. 
K The K key. 
L The L key. 
LaunchApp1 The Start Application 1 key (Microsoft Natural Keyboard, Windows 2000 or later). 
LaunchApp2 The Start Application 2 key (Microsoft Natural Keyboard, Windows 2000 or later). 
LaunchMail The Start Mail key (Microsoft Natural Keyboard, Windows 2000 or later). 
LaunchMediaSelect The Select Media key (Microsoft Natural Keyboard, Windows 2000 or later). 
LeftArrow The LEFT ARROW key. 
LeftWindows The left Windows logo key (Microsoft Natural Keyboard). 
M The M key. 
MediaNext The Media Next Track key (Windows 2000 or later). 
MediaPlay The Media Play/Pause key (Windows 2000 or later). 
MediaPrevious The Media Previous Track key (Windows 2000 or later). 
MediaStop The Media Stop key (Windows 2000 or later). 
Multiply The Multiply key. 
N The N key. 
NoName A constant reserved for future use. 
NumPad0 The 0 key on the numeric keypad. 
NumPad1 The 1 key on the numeric keypad. 
NumPad2 The 2 key on the numeric keypad. 
NumPad3 The 3 key on the numeric keypad. 
NumPad4 The 4 key on the numeric keypad. 
NumPad5 The 5 key on the numeric keypad. 
NumPad6 The 6 key on the numeric keypad. 
NumPad7 The 7 key on the numeric keypad. 
NumPad8 The 8 key on the numeric keypad. 
NumPad9 The 9 key on the numeric keypad. 
O The O key. 
Oem1 The OEM 1 key (OEM specific). 
Oem102 The OEM 102 key (OEM specific). 
Oem2 The OEM 2 key (OEM specific). 
Oem3 The OEM 3 key (OEM specific). 
Oem4 The OEM 4 key (OEM specific). 
Oem5 The OEM 5 (OEM specific). 
Oem6 The OEM 6 key (OEM specific). 
Oem7 The OEM 7 key (OEM specific). 
Oem8 The OEM 8 key (OEM specific). 
OemClear The CLEAR key (OEM specific). 
OemComma The OEM Comma key on any country/region keyboard (Windows 2000 or later). 
OemMinus The OEM Minus key on any country/region keyboard (Windows 2000 or later). 
OemPeriod The OEM Period key on any country/region keyboard (Windows 2000 or later). 
OemPlus The OEM Plus key on any country/region keyboard (Windows 2000 or later). 
P The P key. 
Pa1 The PA1 key. 
Packet The PACKET key (used to pass Unicode characters with keystrokes). 
PageDown The PAGE DOWN key. 
PageUp The PAGE UP key. 
Pause The PAUSE key. 
Play The PLAY key. 
Print The PRINT key. 
PrintScreen The PRINT SCREEN key. 
Process The IME PROCESS key. 
Q The Q key. 
R The R key. 
RightArrow The RIGHT ARROW key. 
RightWindows The right Windows logo key (Microsoft Natural Keyboard). 
S The S key. 
Select The SELECT key. 
Separator The Separator key. 
Sleep The Computer Sleep key. 
Spacebar The SPACEBAR key. 
Subtract The Subtract key. 
T The T key. 
Tab The TAB key. 
U The U key. 
UpArrow The UP ARROW key. 
V The V key. 
VolumeDown The Volume Down key (Microsoft Natural Keyboard, Windows 2000 or later). 
VolumeMute The Volume Mute key (Microsoft Natural Keyboard, Windows 2000 or later). 
VolumeUp The Volume Up key (Microsoft Natural Keyboard, Windows 2000 or later). 
W The W key. 
X The X key. 
Y The Y key. 
Z The Z key. 
Zoom The ZOOM key. 

The ConsoleKey enumeration is typically used in the System.ConsoleKeyInfo structure, which is returned by the Console.ReadKey method to indicate which key on the console has been pressed.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ