Generated by DocFX

Class ConsoleKeyEx

A class that wraps both ConsoleKey and ConsoleModifiers to provide a clear representation of a keypress

Inheritance
System.Object
ConsoleKeyEx
Implements
System.IEquatable<ConsoleKeyEx>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dotnet.Shell.Logic.Console
Assembly: dotnet-shell-lib.dll
Syntax
public class ConsoleKeyEx : IEquatable<ConsoleKeyEx>

Constructors

| Improve this Doc View Source

ConsoleKeyEx(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 Source

Any

Gets an object representing ANY keypress

Declaration
public static ConsoleKeyEx Any { get; }
Property Value
Type Description
ConsoleKeyEx

Any keypress object

| Improve this Doc View Source

Key

Gets the key.

Declaration
public ConsoleKey? Key { get; }
Property Value
Type Description
System.Nullable<System.ConsoleKey>

The key.

| Improve this Doc View Source

Modifier

Gets the modifier.

Declaration
public ConsoleModifiers Modifier { get; }
Property Value
Type Description
System.ConsoleModifiers

The modifier.

Methods

| Improve this Doc View Source

Equals(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 other parameter; otherwise, false.

| Improve this Doc View Source

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

true if the specified System.Object is equal to this instance; otherwise, false.

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

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.

Overrides
System.Object.GetHashCode()

Implements

System.IEquatable<T>

See Also

System.IEquatable<T>