Skip to content
docsv0.3.0

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): void

Registers a binding; a later binding for the same key and scope replaces it.

Parameters

Parameters of register()
NameTypeDescription
$bindingMilpa\Live\ValueObjects\Tui\ShortcutBinding

InMemoryShortcutRegistry::resolve()

public function resolve(string $key, string $scope = 'global'): ?Milpa\Live\ValueObjects\Tui\ShortcutBinding

The binding for this key in this scope, or null when nothing claims it.

Parameters

Parameters of resolve()
NameTypeDescription
$keystring
$scopestring

InMemoryShortcutRegistry::all()

public function all(?string $scope = null): array

Every registered binding, or only those of the given scope.

Parameters

Parameters of all()
NameTypeDescription
$scope?string