Table of Contents

Constructor Shortcut

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Shortcut()

Creates a new instance of Shortcut.

public Shortcut()

Shortcut(View, Command, string, string)

Creates a new instance of Shortcut, binding it to targetView and command. The Key targetView has bound to command will be used as Key.

public Shortcut(View targetView, Command command, string commandText, string helpText)

Parameters

targetView View

The View that command will be invoked on when user does something that causes the Shortcut's Accept event to be raised.

command Command

The Command to invoke on targetView. The Key targetView has bound to command will be used as Key

commandText string

The text to display for the command.

helpText string

The help text to display.

Remarks

This is a helper API that simplifies creation of multiple Shortcuts when adding them to Bar-based objects, like MenuBarv2.

Shortcut(Key, string?, Action?, string?)

Creates a new instance of Shortcut.

public Shortcut(Key key, string? commandText, Action? action, string? helpText = null)

Parameters

key Key
commandText string

The text to display for the command.

action Action
helpText string

The help text to display.

Remarks

This is a helper API that mimics the V1 API for creating StatusItems.