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 Application class, enabling parallelizable unit tests and better testability.

public interface IKeyboard

Properties

Application

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

ArrangeKey

Gets or sets the key to activate arranging views using the keyboard.

KeyBindings

Gets the Application-scoped key bindings.

NextTabGroupKey

Alternative key to navigate forwards through views. Ctrl+Tab is the primary key.

NextTabKey

Alternative key to navigate forwards through views. Tab is the primary key.

PrevTabGroupKey

Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.

PrevTabKey

Alternative key to navigate backwards through views. Shift+Tab is the primary key.

QuitKey

Gets or sets the key to quit the application.

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 IConsoleDriver). 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 the user releases a key (by the IConsoleDriver). Raises the cancelable KeyUp event then calls NewKeyUpEvent(Key) on all top level views. Called after RaiseKeyDownEvent(Key).

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.