Table of Contents

Class AnsiInputProcessor

Namespace
Terminal.Gui.Drivers
Assembly
Terminal.Gui.dll

Input processor for AnsiInput, processes a char stream using pure ANSI escape sequence handling.

ANSI Driver Architecture:

This processor integrates with Terminal.Gui's ANSI infrastructure:

  • Terminal.Gui.Drivers.AnsiResponseParser<TInputRecord> - Automatically parses ANSI escape sequences from the input stream, extracting keyboard events, mouse events, and terminal responses.
  • AnsiRequestScheduler - Manages outgoing ANSI requests (via QueueAnsiRequest(AnsiEscapeSequenceRequest)) and matches responses from the parser.
  • Terminal.Gui.Drivers.AnsiKeyConverter - Converts character input to Key events, shared with UnixDriver for consistent ANSI-based key mapping.
  • AnsiKeyboardEncoder and AnsiMouseEncoder - Convert Key and Mouse events into ANSI sequences for test injection.

The parser is configured in the base class InputProcessorImpl<TInputRecord> with HandleMouse = true and HandleKeyboard = true, enabling automatic event raising.

public class AnsiInputProcessor : InputProcessorImpl<char>, IInputProcessor, IDisposable
Inheritance
AnsiInputProcessor
Implements
Inherited Members

Constructors

AnsiInputProcessor(ConcurrentQueue<char>, ITimeProvider?)

Methods

InjectKeyDownEvent(Key)

Injects a key down event. For unit tests.

InjectMouseEvent(IApplication?, Mouse)

Enqueues a mouse event. For unit tests.

Process(char)

Processes a single input element dequeued from InputQueue. Called sequentially for each dequeued value.