foo-webview-sdk
    Preparing search index...

    Variable keyboardConst

    keyboard: {
        getRegisteredHotkeys: () => Promise<
            KeyboardGetRegisteredHotkeysResponse,
        >;
        registerHotkey: (
            key: string,
            action: string,
            opts?: Omit<KeyboardRegisterHotkeyParams, "key" | "action">,
        ) => Promise<KeyboardRegisterHotkeyResponse>;
        registerShortcut: (
            key: string,
            action: string,
        ) => Promise<KeyboardRegisterShortcutResponse>;
        setReservedKeys: (
            keys: string[],
            options?: { all?: boolean },
        ) => Promise<KeyboardSetReservedKeysResponse>;
        unregisterHotkey: (
            opts: KeyboardUnregisterHotkeyParams,
        ) => Promise<KeyboardUnregisterHotkeyResponse>;
    } = ...

    keyboard — hotkey / shortcut registration namespace.

    Type Declaration

    • getRegisteredHotkeys: () => Promise<KeyboardGetRegisteredHotkeysResponse>

      List registered system hotkeys followed by local shortcuts. The shortcut entries go away with registerShortcut in 3.0.

    • registerHotkey: (
          key: string,
          action: string,
          opts?: Omit<KeyboardRegisterHotkeyParams, "key" | "action">,
      ) => Promise<KeyboardRegisterHotkeyResponse>

      Register a system-wide hotkey; the response carries the numeric id. The hotkey is released when this page navigates or reloads and when its window closes.

    • registerShortcut: (key: string, action: string) => Promise<KeyboardRegisterShortcutResponse>

      Store a key combination under an action name. Nothing matches key presses against it.

      Has no effect and will be removed in 3.0; listen for keydown in the page instead.

    • setReservedKeys: (
          keys: string[],
          options?: { all?: boolean },
      ) => Promise<KeyboardSetReservedKeysResponse>

      Replace this page's reserved keys: combinations that stay with the page while it has the focus, even when foobar2000 has a keyboard shortcut for them. Cleared when the page navigates or reloads; an empty array releases them all. With { all: true } every key stays with the page, for example while it records a shortcut; call again without it to keep only keys.

    • unregisterHotkey: (
          opts: KeyboardUnregisterHotkeyParams,
      ) => Promise<KeyboardUnregisterHotkeyResponse>

      Takes exactly one of the numeric id and the original key string. Removing a shortcut by key goes away with registerShortcut in 3.0.