Table of Contents

Interface IKeyboard

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

Defines a contract for managing keyboard input and key bindings at the Application level.

This interface decouples keyboard handling state from the static App class, enabling parallelizable unit tests and better testability.

public interface IKeyboard

Properties

App

Sets the application instance that this keyboard handler is associated with. This provides access to application state without coupling to static Application class.

KeyBindings

Gets the Application-scoped key bindings.

Methods

InvokeCommand(Command, Key, KeyBinding)

Invokes an Application-bound command.

InvokeCommandsBoundToKey(Key)

Invokes any commands bound at the Application-level to key.

RaiseKeyDownEvent(Key)

Called when the user presses a key (by the IDriver). Raises the cancelable KeyDown event, then calls NewKeyDownEvent(Key) on all top level views, and finally if the key was not handled, invokes any Application-scoped KeyBindings.

RaiseKeyUpEvent(Key)

Called when a key is released (by the IDriver). Raises the cancelable KeyUp event, then calls NewKeyUpEvent(Key) on all top level views.

Events

KeyDown

Raised when the user presses a key.

Set Handled to true to indicate the key was handled and to prevent additional processing.

KeyUp

Raised when the user releases a key.

Set Handled to true to indicate the key was handled and to prevent additional processing.