Table of Contents

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

int

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

keys ConsoleKeyInfo[]

Returns

ScriptedInputSource

EnqueueMouse(MouseEvent)

Queue a mouse event, in order with the queued keys and pastes.

public ScriptedInputSource EnqueueMouse(MouseEvent mouse)

Parameters

mouse MouseEvent

Returns

ScriptedInputSource

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

text string

Returns

ScriptedInputSource

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

text string

Returns

ScriptedInputSource

TryRead(out ConsoleKeyInfo)

Read the next key, skipping any pastes and mouse events ahead of it.

public bool TryRead(out ConsoleKeyInfo key)

Parameters

key ConsoleKeyInfo

Returns

bool