Defined in: controllers/hotkey.ts:26
A Lit ReactiveController that registers a keyboard hotkey when the host element is connected and unregisters it when the host is disconnected.
class MyElement extends LitElement {
private hotkey = new HotkeyController(this, 'Mod+S', () => this.save())
constructor() {
super()
this.addController(this.hotkey)
}
}new HotkeyController(
_host,
_hotkey,
callback,
_options?): HotkeyController;Defined in: controllers/hotkey.ts:37
ReactiveControllerHost
The Lit component that owns this controller. Add the controller with addController().
RegisterableHotkey
The shortcut to register.
HotkeyCallback
Called with the host as this.
HotkeyOptions | (() => HotkeyOptions)
Options or a getter. Property getters are read on connection and after host updates.
HotkeyController
hostConnected(): void;Defined in: controllers/hotkey.ts:48
Registers when connected and a target is available.
void
ReactiveController.hostConnectedhostDisconnected(): void;Defined in: controllers/hotkey.ts:67
Releases registrations when the host disconnects.
void
ReactiveController.hostDisconnectedhostUpdated(): void;Defined in: controllers/hotkey.ts:54
Refreshes options after rendering, when scoped targets are available.
void
ReactiveController.hostUpdated