Table of Contents

Method GetInputInjector

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

GetInputInjector()

Gets the input injector for programmatic input injection in tests.

IInputInjector GetInputInjector()

Returns

IInputInjector

The IInputInjector for input injection.

Remarks

The input injector provides a simplified API for injecting keyboard and mouse events in tests. It handles encoding, queueing, and processing automatically.

Use Create(ITimeProvider?) to create an application with VirtualTimeProvider for deterministic, fast tests.

Example usage:

VirtualTimeProvider time = new ();
    using IApplication app = Application.Create (time);
    app.Init ();
    app.InjectKey (Key.Enter);  // Extension method uses GetInputInjector()