InMemoryShortcutRegistry
Keyboard shortcuts held in memory and resolved per scope, so the same key can mean different things depending on which surface has focus.
InMemoryShortcutRegistry::register()
public function register(Milpa\Live\ValueObjects\Tui\ShortcutBinding $binding): voidRegisters a binding; a later binding for the same key and scope replaces it.
Parameters
| Name | Type | Description |
|---|---|---|
| $binding | Milpa\Live\ValueObjects\Tui\ShortcutBinding |
InMemoryShortcutRegistry::resolve()
public function resolve(string $key, string $scope = 'global'): ?Milpa\Live\ValueObjects\Tui\ShortcutBindingThe binding for this key in this scope, or null when nothing claims it.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $scope | string |
InMemoryShortcutRegistry::all()
public function all(?string $scope = null): arrayEvery registered binding, or only those of the given scope.
Parameters
| Name | Type | Description |
|---|---|---|
| $scope | ?string |