Defined in: controllers/app-hotkeys.ts:41
A Lit ReactiveController for app hotkeys provided with provideAppHotkeys: the effective app hotkeys, a cheat sheet list with live status, and the user's custom hotkeys. Requests an update when any of them change.
class CheatSheet extends LitElement {
private app = new AppHotkeysController(this)
render() {
return html`<ul>
${this.app.list.map(
({ appHotkey, status }) => html`<li>${appHotkey.meta?.name}: ${status}</li>`,
)}
</ul>`
}
}new AppHotkeysController(_host): AppHotkeysController;Defined in: controllers/app-hotkeys.ts:44
ReactiveControllerHost
AppHotkeysController
get appHotkeys(): RegisteredAppHotkeys;Defined in: controllers/app-hotkeys.ts:49
Effective app hotkeys, typed by Register.
RegisteredAppHotkeys
get customHotkeys(): CustomHotkeys;Defined in: controllers/app-hotkeys.ts:65
The user's hotkeys that differ from the defaults.
CustomHotkeys
get list(): AppHotkeyListItem<AppHotkey<string, HotkeyChord | HotkeySequence | null>>[];Defined in: controllers/app-hotkeys.ts:54
Every app hotkey with its live status, in declaration order.
AppHotkeyListItem<AppHotkey<string, HotkeyChord | HotkeySequence | null>>[]
findConflicts(id, hotkey): AppHotkey<string, HotkeyChord | HotkeySequence | null>[];Defined in: controllers/app-hotkeys.ts:91
Other app hotkeys that would collide if id used hotkey.
string
Hotkey
AppHotkey<string, HotkeyChord | HotkeySequence | null>[]
hostConnected(): void;Defined in: controllers/app-hotkeys.ts:98
Called when the host is connected to the component tree. For custom element hosts, this corresponds to the connectedCallback() lifecycle, which is only called when the component is connected to the document.
void
ReactiveController.hostConnectedhostDisconnected(): void;Defined in: controllers/app-hotkeys.ts:108
Called when the host is disconnected from the component tree. For custom element hosts, this corresponds to the disconnectedCallback() lifecycle, which is called the host or an ancestor component is disconnected from the document.
void
ReactiveController.hostDisconnectedresetCustomHotkey(id): void;Defined in: controllers/app-hotkeys.ts:81
Restores the default hotkey for an app hotkey.
string
void
resetCustomHotkeys(): void;Defined in: controllers/app-hotkeys.ts:86
Restores every default hotkey.
void
setCustomHotkey(id, hotkey): AppHotkey<string, HotkeyChord | HotkeySequence | null>[];Defined in: controllers/app-hotkeys.ts:73
Sets the user's hotkey for an app hotkey. null unbinds it. Returns conflicting app hotkeys; when any exist, nothing changes.
string
Hotkey | null
AppHotkey<string, HotkeyChord | HotkeySequence | null>[]