MAIDR JavaScript API
    Preparing search index...

    Function comboFromKeyboardEvent

    • The shortcut a keydown event spells, in the form hotkeys-js binds.

      Modifier-only presses answer null: the reader is still holding the chord. So does a key no shortcut may use; see UNSUPPORTED_CODES. Ctrl and the Command key are told apart -- ctrl and command are different keys to hotkeys-js on every platform -- so a Mac reader who records Command+B gets Command+B, not the Control+B the same chord means on Windows.

      Parameters

      • event: KeyboardEvent

        The keydown event

      Returns string | null

      The combo, or null when the press is not a usable shortcut