IAnsiConsoleInput

Represents the console's input mechanism.

Represents the console's input mechanism.

Methods

public bool IsKeyAvailable()

Gets a value indicating whether or not there is a key available.

Returns:

true if there's a key available, otherwise false.

public ConsoleKeyInfo? ReadKey(bool intercept)

Reads a key from the console.

Parameters:

intercept (bool)
Whether or not to intercept the key.

Returns:

The key that was read.

public Task<ConsoleKeyInfo?> ReadKeyAsync(bool intercept, CancellationToken cancellationToken)

Reads a key from the console.

Parameters:

intercept (bool)
Whether or not to intercept the key.
cancellationToken (CancellationToken)
The token to monitor for cancellation requests.

Returns:

The key that was read.