Defined in: controllers/hotkey-scopes-state.ts:23
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:35
ReactiveControllerHost
The Lit component that owns this controller.
HotkeyScopesStateController
get value(): HotkeyScopesState;Defined in: controllers/hotkey-scopes-state.ts:28
The current scope state.
HotkeyScopesState
hostConnected(): void;Defined in: controllers/hotkey-scopes-state.ts:44
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:54
Unsubscribes from the scopes store.
void
ReactiveController.hostDisconnected