Export (0) Print
Expand All
Expand Minimize

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 nameDescription
AThe A key. 
AddThe Add key. 
ApplicationsThe Application key (Microsoft Natural Keyboard). 
AttentionThe ATTN key. 
BThe B key. 
BackspaceThe BACKSPACE key. 
BrowserBackThe Browser Back key (Windows 2000 or later). 
BrowserFavoritesThe Browser Favorites key (Windows 2000 or later). 
BrowserForwardThe Browser Forward key (Windows 2000 or later). 
BrowserHomeThe Browser Home key (Windows 2000 or later). 
BrowserRefreshThe Browser Refresh key (Windows 2000 or later). 
BrowserSearchThe Browser Search key (Windows 2000 or later). 
BrowserStopThe Browser Stop key (Windows 2000 or later). 
CThe C key. 
ClearThe CLEAR key. 
CrSelThe CRSEL (CURSOR SELECT) key. 
DThe D key. 
D0The 0 key. 
D1The 1 key. 
D2The 2 key. 
D3The 3 key. 
D4The 4 key. 
D5The 5 key. 
D6The 6 key. 
D7The 7 key. 
D8The 8 key. 
D9The 9 key. 
DecimalThe Decimal key. 
DeleteThe DEL (DELETE) key. 
DivideThe Divide key. 
DownArrowThe DOWN ARROW key. 
EThe E key. 
EndThe END key. 
EnterThe ENTER key. 
EraseEndOfFileThe ERASE EOF key. 
EscapeThe ESC (ESCAPE) key. 
ExecuteThe EXECUTE key. 
ExSelThe EXSEL (EXTEND SELECTION) key. 
FThe F key. 
F1The F1 key. 
F10The F10 key. 
F11The F11 key. 
F12The F12 key. 
F13The F13 key. 
F14The F14 key. 
F15The F15 key. 
F16The F16 key. 
F17The F17 key. 
F18The F18 key. 
F19The F19 key. 
F2The F2 key. 
F20The F20 key. 
F21The F21 key. 
F22The F22 key. 
F23The F23 key. 
F24The F24 key. 
F3The F3 key. 
F4The F4 key. 
F5The F5 key. 
F6The F6 key. 
F7The F7 key. 
F8The F8 key. 
F9The F9 key. 
GThe G key. 
HThe H key. 
HelpThe HELP key. 
HomeThe HOME key. 
IThe I key. 
InsertThe INS (INSERT) key. 
JThe J key. 
KThe K key. 
LThe L key. 
LaunchApp1The Start Application 1 key (Microsoft Natural Keyboard, Windows 2000 or later). 
LaunchApp2The Start Application 2 key (Microsoft Natural Keyboard, Windows 2000 or later). 
LaunchMailThe Start Mail key (Microsoft Natural Keyboard, Windows 2000 or later). 
LaunchMediaSelectThe Select Media key (Microsoft Natural Keyboard, Windows 2000 or later). 
LeftArrowThe LEFT ARROW key. 
LeftWindowsThe left Windows logo key (Microsoft Natural Keyboard). 
MThe M key. 
MediaNextThe Media Next Track key (Windows 2000 or later). 
MediaPlayThe Media Play/Pause key (Windows 2000 or later). 
MediaPreviousThe Media Previous Track key (Windows 2000 or later). 
MediaStopThe Media Stop key (Windows 2000 or later). 
MultiplyThe Multiply key. 
NThe N key. 
NoNameA constant reserved for future use. 
NumPad0The 0 key on the numeric keypad. 
NumPad1The 1 key on the numeric keypad. 
NumPad2The 2 key on the numeric keypad. 
NumPad3The 3 key on the numeric keypad. 
NumPad4The 4 key on the numeric keypad. 
NumPad5The 5 key on the numeric keypad. 
NumPad6The 6 key on the numeric keypad. 
NumPad7The 7 key on the numeric keypad. 
NumPad8The 8 key on the numeric keypad. 
NumPad9The 9 key on the numeric keypad. 
OThe O key. 
Oem1The OEM 1 key (OEM specific). 
Oem102The OEM 102 key (OEM specific). 
Oem2The OEM 2 key (OEM specific). 
Oem3The OEM 3 key (OEM specific). 
Oem4The OEM 4 key (OEM specific). 
Oem5The OEM 5 (OEM specific). 
Oem6The OEM 6 key (OEM specific). 
Oem7The OEM 7 key (OEM specific). 
Oem8The OEM 8 key (OEM specific). 
OemClearThe CLEAR key (OEM specific). 
OemCommaThe OEM Comma key on any country/region keyboard (Windows 2000 or later). 
OemMinusThe OEM Minus key on any country/region keyboard (Windows 2000 or later). 
OemPeriodThe OEM Period key on any country/region keyboard (Windows 2000 or later). 
OemPlusThe OEM Plus key on any country/region keyboard (Windows 2000 or later). 
PThe P key. 
Pa1The PA1 key. 
PacketThe PACKET key (used to pass Unicode characters with keystrokes). 
PageDownThe PAGE DOWN key. 
PageUpThe PAGE UP key. 
PauseThe PAUSE key. 
PlayThe PLAY key. 
PrintThe PRINT key. 
PrintScreenThe PRINT SCREEN key. 
ProcessThe IME PROCESS key. 
QThe Q key. 
RThe R key. 
RightArrowThe RIGHT ARROW key. 
RightWindowsThe right Windows logo key (Microsoft Natural Keyboard). 
SThe S key. 
SelectThe SELECT key. 
SeparatorThe Separator key. 
SleepThe Computer Sleep key. 
SpacebarThe SPACEBAR key. 
SubtractThe Subtract key. 
TThe T key. 
TabThe TAB key. 
UThe U key. 
UpArrowThe UP ARROW key. 
VThe V key. 
VolumeDownThe Volume Down key (Microsoft Natural Keyboard, Windows 2000 or later). 
VolumeMuteThe Volume Mute key (Microsoft Natural Keyboard, Windows 2000 or later). 
VolumeUpThe Volume Up key (Microsoft Natural Keyboard, Windows 2000 or later). 
WThe W key. 
XThe X key. 
YThe Y key. 
ZThe Z key. 
ZoomThe 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

Community Additions

ADD
Show:
© 2014 Microsoft