Defined in: controllers/hotkey-scopes-state.ts:22
A Lit ReactiveController that reads the hotkey manager's scope state: the active scopes, the exclusive scope that owns the keyboard, and the scopes it allows or suspends. Triggers host updates when scopes activate or release.
class KeyboardOwner extends LitElement {
private scopes = new HotkeyScopesStateController(this)
render() {
const { exclusive } = this.scopes.value
return exclusive ? html`<p>Shortcuts belong to ${exclusive}</p>` : nothing
}
}new HotkeyScopesStateController(_host): HotkeyScopesStateController;Defined in: controllers/hotkey-scopes-state.ts:34
ReactiveControllerHost
The Lit component that owns this controller.
HotkeyScopesStateController
get value(): HotkeyScopesState;Defined in: controllers/hotkey-scopes-state.ts:27
The current scope state.
HotkeyScopesState
hostConnected(): void;Defined in: controllers/hotkey-scopes-state.ts:43
Subscribes to the scopes store and updates the host when it changes. Connecting requests an update too, since scopes may have changed while disconnected.
void
ReactiveController.hostConnectedhostDisconnected(): void;Defined in: controllers/hotkey-scopes-state.ts:52
Unsubscribes from the scopes store.
void
ReactiveController.hostDisconnected