public sealed class CommandDispatcherTurns keystrokes into commands.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One handler on the root, on the bubble leg. A key event is routed from the focus outwards, so by the time it reaches the root every control that might have wanted it has had its turn — which is what makes Ctrl+Z undo in the scene and undo the typing inside a text box, with no list of exceptions anywhere.
⚠ A chord with no Control or Meta is not taken from a text field. Otherwise a single-key binding — F for frame-selection, which every 3D editor has — would fire while somebody was naming an object, and the object would end up called Cubeaaa with the camera somewhere else. Function keys are exempt, because they are not text.
Auto-repeat is ignored. Holding Ctrl+S must save once; the platform reports a stream of presses and IsRepeat is what tells them apart.
Events (1)
public Action<EditorCommand>? RefusedRaised when a chord matched a command that could not run.
Methods (3)
public CommandDispatcher(CommandRegistry commands, KeyMap keys)Creates a dispatcher over a registry and a keymap.
public void Attach(UiDocument document)Listens for shortcuts in a document.
public bool Pressed(UiDocument document, KeyEvent args)Runs whatever a key event is bound to.
Used by (4)
- CommandTestsVixen.Editor.Ui.Tests
- EditorShellVixen.Editor.Ui
- PlatformKeyTestsVixen.Editor.Ui.Tests
- ScopeTestsVixen.Editor.Ui.Tests