IReplKeyReader
Injectable service for handlers that need raw key input (watch/top pattern). When a handler declares this parameter, it owns the console input and decides what each key means. Custom IReplPagerRenderer implementations can also use this service through ReplPagerRenderContext to drive interactive navigation without depending directly on Console.
- Kind:
Interface - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/IReplKeyReader.cs
Signature
Section titled “Signature”public interface IReplKeyReaderDerived Classes
Section titled “Derived Classes”Methods
Section titled “Methods”ReadKeyAsync(CancellationToken)
Section titled “ReadKeyAsync(CancellationToken)”Reads the next key press. Blocks until a key is available or token is cancelled.
ValueTask<ConsoleKeyInfo> ReadKeyAsync(CancellationToken ct)Parameters
Section titled “Parameters”ct(CancellationToken): Cancellation token.
Returns
Section titled “Returns”ValueTask<ConsoleKeyInfo> - The key info of the pressed key.
Properties
Section titled “Properties”KeyAvailable
Section titled “KeyAvailable”Returns true if a key is available to read without blocking.
bool KeyAvailable { get; }