Table of Contents

Class EditorBindings

Namespace
Icy.Design.Editor
Assembly
IcyUI.Design.dll

The key gestures an EditorSession registers for its EditorCommands.

public sealed class EditorBindings : IEnumerable<KeyValuePair<KeyGesture, ICommand>>, IEnumerable
Inheritance
EditorBindings
Implements
Inherited Members
Extension Methods

Remarks

Gestures are registered with handlesGesture: true (see RegisterCommand(ICommand, KeyGesture, object?, bool)), so in Edit the editor's commands win over a game's own bindings for the same keys, and in Interact (when they can't execute) the game gets the keys back.

The defaults:

Ctrl+Shift+EToggleMode. F1/F2 are left to the game's debug tools.
EscDeselect
Alt+Up / Alt+DownSelectParent / SelectFirstChild
Alt+Left / Alt+RightSelectPrevious / SelectNext
DeleteDelete
Ctrl+ZUndo
Ctrl+Y, Ctrl+Shift+ZRedo
Arrows / Shift+ArrowsThe nudges, by 1 and by LargeNudge.

Changes made while the session is attached take effect immediately.

While a TextBox on the canvas has focus, the bindings stand down, so typing in a panel never moves or deletes the selection. The keys then reach the text box and the game as usual.

Arrow gestures stand down while any control on the canvas has focus, so arrows in a focused list or tree move its highlight instead of also nudging the selection. Pressing on the page in Edit mode clears the focus again.

Properties

this[KeyGesture]

Gets the command bound to gesture, or null.

public ICommand? this[KeyGesture gesture] { get; }

Parameters

gesture KeyGesture

The key gesture.

Property Value

ICommand

The bound command, or null.

Methods

Bind(KeyGesture, ICommand)

Binds gesture to command, replacing any earlier binding for it.

public void Bind(KeyGesture gesture, ICommand command)

Parameters

gesture KeyGesture

The key gesture.

command ICommand

The command; usually one of Commands.

Exceptions

ArgumentNullException

command is null.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<KeyValuePair<KeyGesture, ICommand>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<KeyGesture, ICommand>>

An enumerator that can be used to iterate through the collection.

Unbind(KeyGesture)

Removes the binding for gesture.

public bool Unbind(KeyGesture gesture)

Parameters

gesture KeyGesture

The key gesture.

Returns

bool

true when a binding was removed.