ConsoleKeyInfo

ConsoleKeyInfo


Describes the console key that was pressed, including the character represented by the console key and the state of the SHIFT, ALT, and CTRL modifier keys.


Implements:

IObject 

Public:

Types:

NameDescription
 ConsoleKey A list of all the scankey codes.  
 ConsoleModifiers Values that represent the specific modifier keys used to indicate different values for specific keys.  

Properties:

NameDescription
 Key (get) Returns the scankey code of the pressed key.  
 KeyChar (get) Returns the Unicode character of the pressed key.  
 Modifiers (get) Returns the state of the key modifiers (Shift, Alt, Control) at the time of the key press.  

Methods:

NameDescription
 Equals Gets a value indicating whether the specified ConsoleKeyInfo object is equal to the current ConsoleKeyInfo object.  
 GetHashCode Returns the hash code for the current ConsoleKeyInfo object.  
 ToString Returns a string representation of this object instance.  

Remarks

When a key pressed on a console, a ConsoleKeyInfo object is generated by reading the pressed key using the ReadKey method. The generated object contains the key press information describing the event.

See Also

Project CorLib Overview

Class ConsoleKeyInfo Overview

Console