Skip to content

Keyboard functions

Functions related to the keyboard

formatShortcut(shortcut)

Formats a shortcut (combination of keys) into a human-readable format.

For a list of valid key values, refer to this page: Key values for keyboard events - Web APIs | MDN

Parameters

  • shortcut - A list of keys
    • Type: string[]

Returns

  • Type: string

Example

ts
formatShortcut(["Control", "a"])
// Result: "Ctrl+A"

Built by Prozilla