API Reference
Interface
IInputSource
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.
Returned or exposed by 9
- Method ConsoleInput.OpenConsole
- Property ConsoleInput.Override
- Property InputLease.Source
- Property InteractiveOptions.Input
- Property ConsoleTarget.Input
- Property ITerminalTarget.Input
- Property NullTarget.Input
- Property RecordingTarget.Input
- Property WriterTarget.Input
Accepted by parameters 1
- Method ConsoleInput.Acquire
Methods
public abstract InputEvent? Read(TimeSpan timeout, CancellationToken cancellationToken) #Returns:
InputEvent?Waits up to timeout for the next event.
Parameters
- timeout System.TimeSpan
- The longest wait; TimeSpan.Zero polls.
- cancellationToken System.Threading.CancellationToken
- Cancels the wait with OperationCanceledException.
Returns
The event, or null when the timeout passed without input.
Exceptions
InputClosedException– The input ended (end of a script, closed stdin).
Properties
public abstract String Name { get; } #A short description for diagnostics, for example windows console (ReadConsoleInputW).