Class EditorBindings
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+E | ToggleMode. F1/F2 are left to the game's debug tools. |
| Esc | Deselect |
| Alt+Up / Alt+Down | SelectParent / SelectFirstChild |
| Alt+Left / Alt+Right | SelectPrevious / SelectNext |
| Delete | Delete |
| Ctrl+Z | Undo |
| Ctrl+Y, Ctrl+Shift+Z | Redo |
| Arrows / Shift+Arrows | The 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
gestureKeyGestureThe key gesture.
Property Value
Methods
Bind(KeyGesture, ICommand)
Binds gesture to command, replacing any earlier binding for it.
public void Bind(KeyGesture gesture, ICommand command)
Parameters
gestureKeyGestureThe key gesture.
commandICommandThe command; usually one of Commands.
Exceptions
- ArgumentNullException
commandis 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
gestureKeyGestureThe key gesture.