@twip/web
    Preparing search index...

    Interface Shortcuts

    Keyboard shortcuts: the application's own, and what a key does now.

    interface Shortcuts {
        lookup(
            keys: string,
        ):
            | { id: keyof Commands; kind: "command" }
            | { id: string; kind: "shortcut" }
            | { command: HostCommand; kind: "host" }
            | null;
        register(
            shortcut: {
                id: string;
                keys: string | { mac: string; windows: string };
            },
        ): () => void;
    }
    Index
    • What a key does now: a command, an application shortcut, a host command, or nothing.

      Parameters

      • keys: string

      Returns
          | { id: keyof Commands; kind: "command" }
          | { id: string; kind: "shortcut" }
          | { command: HostCommand; kind: "host" }
          | null

    • Claims a key for the application: pressing it emits shortcut. Throws 'unavailable' on a collision, naming it.

      Parameters

      • shortcut: { id: string; keys: string | { mac: string; windows: string } }

      Returns () => void