Table of Contents

Class KeyBindings

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

A class that provides a collection of KeyBinding objects bound to a Key.

public class KeyBindings
Inheritance
KeyBindings
Inherited Members

Properties

Bindings

The collection of KeyBinding objects.

Methods

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, KeyBindingScope, params Command[]) for Focused scoped commands.

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

Add(Key, KeyBinding)

Adds a KeyBinding to the collection.

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.

Clear()

Removes all KeyBinding objects from the collection.

Clear(params Command[])

Removes all key bindings that trigger the given command set. Views can have multiple different keys bound to the same command sets and this method will clear all of them.

Get(Key)

Gets the KeyBinding for the specified Key.

Get(Key, KeyBindingScope)

Gets the KeyBinding for the specified Key.

GetCommands(Key)

Gets the array of Commands bound to key if it exists.

GetKeyFromCommands(params Command[])

Gets the Key used by a set of commands.

Remove(Key)

Removes a KeyBinding from the collection.

Replace(Key, Key)

Replaces a key combination already bound to a set of Commands.

TryGet(Key, out KeyBinding)

Gets the commands bound with the specified Key.

TryGet(Key, KeyBindingScope, out KeyBinding)

Gets the commands bound with the specified Key that are scoped to a particular scope.