Class ConsoleKeyEx
A class that wraps both ConsoleKey and ConsoleModifiers to provide a clear representation of a keypress
Inheritance
Implements
Inherited Members
Namespace: Dotnet.Shell.Logic.Console
Assembly: dotnet-shell-lib.dll
Syntax
public class ConsoleKeyEx : IEquatable<ConsoleKeyEx>
Constructors
| Improve this Doc View SourceConsoleKeyEx(Nullable<ConsoleKey>, ConsoleModifiers)
Initializes a new instance of the ConsoleKeyEx class.
Declaration
public ConsoleKeyEx(ConsoleKey? k, ConsoleModifiers m = (ConsoleModifiers)0)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.ConsoleKey> | k | The k. |
| System.ConsoleModifiers | m | The m. |
Properties
| Improve this Doc View SourceAny
Gets an object representing ANY keypress
Declaration
public static ConsoleKeyEx Any { get; }
Property Value
| Type | Description |
|---|---|
| ConsoleKeyEx | Any keypress object |
Key
Gets the key.
Declaration
public ConsoleKey? Key { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.ConsoleKey> | The key. |
Modifier
Gets the modifier.
Declaration
public ConsoleModifiers Modifier { get; }
Property Value
| Type | Description |
|---|---|
| System.ConsoleModifiers | The modifier. |
Methods
| Improve this Doc View SourceEquals(ConsoleKeyEx)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(ConsoleKeyEx other)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsoleKeyEx | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified System.Object, is equal to this instance.
Declaration
public override bool Equals(object y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | y | The System.Object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |