Table of Contents

Method Add

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Add(Key, KeyBinding, View?)

Adds a KeyBinding to the collection.

public void Add(Key key, KeyBinding binding, View? boundViewForAppScope = null)

Parameters

key Key
binding KeyBinding
boundViewForAppScope View

Optional View for Application bindings.

Add(Key, KeyBindingScope, View?, params Command[])

Adds a new key combination that will trigger the commands in commands.

If the key is already bound to a different array of Commands it will be rebound commands.

public void Add(Key key, KeyBindingScope scope, View? boundViewForAppScope = null, params Command[] commands)

Parameters

key Key

The key to check.

scope KeyBindingScope

The scope for the command.

boundViewForAppScope View

Optional View for Application bindings.

commands Command[]

The command to invoked on the View when key is pressed. When multiple commands are provided,they will be applied in sequence. The bound key strike will be consumed if any took effect.

Remarks

Commands are only ever applied to the current View (i.e. this feature cannot be used to switch focus to another view and perform multiple commands there).

Add(Key, KeyBindingScope, params Command[])

Adds a new key combination that will trigger the commands in commands.

If the key is already bound to a different array of Commands it will be rebound commands.

public void Add(Key key, KeyBindingScope scope, params Command[] commands)

Parameters

key Key

The key to check.

scope KeyBindingScope

The scope for the command.

commands Command[]

The command to invoked on the View when key is pressed. When multiple commands are provided,they will be applied in sequence. The bound key strike will be consumed if any took effect.

Remarks

Commands are only ever applied to the current View (i.e. this feature cannot be used to switch focus to another view and perform multiple commands there).

Add(Key, View?, params Command[])

Adds a new key combination that will trigger the commands in commands (if supported by the View - see GetSupportedCommands()).

This is a helper function for Add(Key, KeyBinding, View?). If used for a View ( BoundView is set), the scope will be set to Focused. Otherwise, it will be set to Application.

If the key is already bound to a different array of Commands it will be rebound commands.

public void Add(Key key, View? boundViewForAppScope = null, params Command[] commands)

Parameters

key Key

The key to check.

boundViewForAppScope View

Optional View for Application bindings.

commands Command[]

The command to invoked on the View when key is pressed. When multiple commands are provided,they will be applied in sequence. The bound key strike will be consumed if any took effect.

Remarks

Commands are only ever applied to the current View (i.e. this feature cannot be used to switch focus to another view and perform multiple commands there).

Add(Key, params Command[])

Adds a new key combination that will trigger the commands in commands (if supported by the View - see GetSupportedCommands()).

This is a helper function for Add(Key, KeyBinding, View?). If used for a View ( BoundView is set), the scope will be set to Focused. Otherwise, it will be set to Application.

If the key is already bound to a different array of Commands it will be rebound commands.

public void Add(Key key, params Command[] commands)

Parameters

key Key

The key to check.

commands Command[]

The command to invoked on the View when key is pressed. When multiple commands are provided,they will be applied in sequence. The bound key strike will be consumed if any took effect.

Remarks

Commands are only ever applied to the current View (i.e. this feature cannot be used to switch focus to another view and perform multiple commands there).