Class ScriptedInputSource
- Namespace
- MiniTui
- Assembly
- MiniTui.dll
An input source fed by code, for tests. Thread-safe.
public sealed class ScriptedInputSource : IInputSource, IDisposable
- Inheritance
-
ScriptedInputSource
- Implements
- Inherited Members
Properties
Pending
The number of keys, pastes and mouse events not yet read.
public int Pending { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Enqueue(params ConsoleKeyInfo[])
Queue keys to be read in order.
public ScriptedInputSource Enqueue(params ConsoleKeyInfo[] keys)
Parameters
keysConsoleKeyInfo[]
Returns
EnqueueMouse(MouseEvent)
Queue a mouse event, in order with the queued keys and pastes.
public ScriptedInputSource EnqueueMouse(MouseEvent mouse)
Parameters
mouseMouseEvent
Returns
EnqueuePaste(string)
Queue a paste, in order with the queued keys. An empty paste is ignored, as terminals' are.
public ScriptedInputSource EnqueuePaste(string text)
Parameters
textstring
Returns
EnqueueText(string)
Queue one key per character. Letters, digits, space, tab and line breaks get their ConsoleKey; uppercase letters are shifted.
public ScriptedInputSource EnqueueText(string text)
Parameters
textstring
Returns
TryRead(out ConsoleKeyInfo)
Read the next key, skipping any pastes and mouse events ahead of it.
public bool TryRead(out ConsoleKeyInfo key)
Parameters
keyConsoleKeyInfo