Table of Contents

Method DefaultHotKeyHandler

Namespace
Terminal.Gui.ViewBase
Assembly
Terminal.Gui.dll

DefaultHotKeyHandler(ICommandContext?)

Called when the user has pressed the View's HotKey and HotKey has been invoked.

public bool? DefaultHotKeyHandler(ICommandContext? ctx)

Parameters

ctx ICommandContext

The command context.

Returns

bool?

true if the command was handled; otherwise, false.

Remarks

View-local HotKeys require the View to be visible in the SuperView chain (CanBeVisible). Application-scoped bindings — those whose Target is this View (e.g. Key with BindKeyToApplication) — are honored even when this View is not visible, so a MenuItem shortcut can fire while its PopoverMenu is closed.

To avoid focusing a hidden View, SetFocus() runs only when the View can be visible.