ComPDFKit Web SDK
    Preparing search index...

    Function off

    • Unbinds keys. With a handler, only that handler is removed; otherwise the key's custom handlers and its built-in shortcut stop. Without arguments, all shortcuts pause.

      Parameters

      • Optionalkey: string

        Keys such as ctrl+shift+=; separate several with commas.

      • Optionalhandler:
            | ((event: KeyboardEvent) => unknown)
            | {
                keydown?: (event: KeyboardEvent) => unknown;
                keyup?: (event: KeyboardEvent) => unknown;
            }

        The handler to remove.

        • (event: KeyboardEvent) => unknown
        • {
              keydown?: (event: KeyboardEvent) => unknown;
              keyup?: (event: KeyboardEvent) => unknown;
          }
          • Optionalkeydown?: (event: KeyboardEvent) => unknown

            Called when the shortcut key is pressed.

          • Optionalkeyup?: (event: KeyboardEvent) => unknown

            Called when the shortcut key is released.

      Returns void

      // Turn off the built-in undo and redo shortcuts
      const { Keys } = instance.UI.hotkeys;
      instance.UI.hotkeys.off(`${Keys.CTRL_Z},${Keys.COMMAND_Z},${Keys.CTRL_Y},${Keys.COMMAND_SHIFT_Z}`);