ShortcutRegistryInterface
Registers and resolves keyboard shortcut bindings by key within a scope (e.g. a modal's own scope vs the `'global'` default), so a TUI runtime can look up "what command does this keypress trigger right now" without every screen/overlay maintaining its own key-to-command table.
ShortcutRegistryInterface::register()
abstract public function register(Milpa\Live\ValueObjects\Tui\ShortcutBinding $binding): voidRegisters a binding, replacing any existing binding for the same key within the same scope.
Parameters
| Name | Type | Description |
|---|---|---|
| $binding | Milpa\Live\ValueObjects\Tui\ShortcutBinding |
ShortcutRegistryInterface::resolve()
abstract public function resolve(string $key, string $scope = 'global'): ?Milpa\Live\ValueObjects\Tui\ShortcutBindingResolves the binding for `$key` within `$scope`. Implementations SHOULD fall back to the `'global'` scope when no binding is registered for `$key` in the requested (non-global) scope, so global shortcuts remain reachable from any scope.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $scope | string |
Returns
`null` if no binding matches, in either the requested scope or the global fallback.
ShortcutRegistryInterface::all()
abstract public function all(?string $scope = null): arrayAll registered bindings, optionally filtered to one scope.
Parameters
| Name | Type | Description |
|---|---|---|
| $scope | ?string |
Returns
All bindings if `$scope` is `null`; only that scope's bindings otherwise.