Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
API Reference
Hotkeys API Reference
Hotkey Sequence API Reference
Key hold & held keys API Reference
Hotkey Recorder API Reference
Hotkey Sequence Recorder API Reference
Normalization & format API Reference
Hotkeys API Reference

HotkeyRegistrationsController

Class: HotkeyRegistrationsController

Defined in: controllers/hotkey-registrations.ts:35

A Lit ReactiveController that tracks all hotkey and sequence registrations.

Subscribes to the singleton HotkeyManager and SequenceManager stores and triggers host updates whenever registrations change.

Example

ts
class ShortcutPalette extends LitElement {
  private registrations = new HotkeyRegistrationsController(this)

  render() {
    return html`
      <ul>
        ${this.registrations.hotkeys.map(
          (reg) => html`<li>${reg.options.meta?.name ?? reg.hotkey}</li>`,
        )}
      </ul>
    `
  }
}
class ShortcutPalette extends LitElement {
  private registrations = new HotkeyRegistrationsController(this)

  render() {
    return html`
      <ul>
        ${this.registrations.hotkeys.map(
          (reg) => html`<li>${reg.options.meta?.name ?? reg.hotkey}</li>`,
        )}
      </ul>
    `
  }
}

Implements

  • ReactiveController

Constructors

Constructor

ts
new HotkeyRegistrationsController(_host): HotkeyRegistrationsController;
new HotkeyRegistrationsController(_host): HotkeyRegistrationsController;

Defined in: controllers/hotkey-registrations.ts:51

Parameters

_host

ReactiveControllerHost

Returns

HotkeyRegistrationsController

Accessors

hotkeys

Get Signature

ts
get hotkeys(): HotkeyRegistrationView[];
get hotkeys(): HotkeyRegistrationView[];

Defined in: controllers/hotkey-registrations.ts:42

All registered hotkeys (public view, no callbacks).

Returns

HotkeyRegistrationView[]


sequences

Get Signature

ts
get sequences(): SequenceRegistrationView[];
get sequences(): SequenceRegistrationView[];

Defined in: controllers/hotkey-registrations.ts:47

All registered sequences.

Returns

SequenceRegistrationView[]

Methods

hostConnected()

ts
hostConnected(): void;
hostConnected(): void;

Defined in: controllers/hotkey-registrations.ts:55

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.

Returns

void

Implementation of

ts
ReactiveController.hostConnected
ReactiveController.hostConnected

hostDisconnected()

ts
hostDisconnected(): void;
hostDisconnected(): void;

Defined in: controllers/hotkey-registrations.ts:81

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.

Returns

void

Implementation of

ts
ReactiveController.hostDisconnected
ReactiveController.hostDisconnected