ShortcutBinding
One keyboard shortcut binding registered with a {@see \Milpa\Live\Contracts\Tui\ShortcutRegistryInterface}: a key bound to a command name within a scope.
ShortcutBinding::__construct()
public function __construct(string $key, string $command, string $label, string $scope = 'global'):Parameters
| Name | Type | Description |
|---|---|---|
| $key | string | The keypress this binding matches (registry-defined format, e.g. `'ctrl+p'`). |
| $command | string | The command name to dispatch when `$key` is pressed within `$scope`. |
| $label | string | Human-readable description, for a shortcut/command palette listing. |
| $scope | string | The scope this binding applies in; `'global'` is reachable from any scope (see {@see \Milpa\Live\Contracts\Tui\ShortcutRegistryInterface::resolve()}). |
Throws
\InvalidArgumentException If `$key` or `$command` is empty.