mwg API
    Preparing search index...

    Function textFromKey

    • The text a keydown produces, or null when it produces none.

      A printable key is one whose event.key is a single character, held without Ctrl/Cmd/Alt (those are shortcuts) and outside a composition (the IME's own events carry that text). Named keys - 'Enter', 'Backspace', 'ArrowLeft', 'Dead', 'Unidentified' - are longer than one character, which is what keeps them out without a hand-maintained exclusion list.

      Parameters

      • event: Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey" | "altKey" | "isComposing">

      Returns string | null