Skip to content
ConsoleMonster

API Reference

Interface

IInputSource

Namespace ConsoleMonster.Input
Assembly ConsoleMonster
Implements
IDisposable
Modifiers abstract

A source of input events: the Windows console (WindowsConsoleInput), a VT terminal, the .NET console key reader, or a script (ScriptedInput) in tests and demos. Only one component reads at a time; get the source through ConsoleInput.Acquire, which enforces that.

Usage

Explore 10 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 1

Methods

public abstract InputEvent? Read(TimeSpan timeout, CancellationToken cancellationToken) #
Returns: InputEvent?

Waits up to timeout for the next event.

Parameters

timeout System.TimeSpan requiredposition: 0
The longest wait; TimeSpan.Zero polls.
cancellationToken System.Threading.CancellationToken requiredposition: 1
Cancels the wait with OperationCanceledException.

Returns

The event, or null when the timeout passed without input.

Exceptions

Properties

public abstract String Name { get; } #

A short description for diagnostics, for example windows console (ReadConsoleInputW).