• Normalize a keystroke into a canonical representation.

    Parameters

    • keystroke: string

      The keystroke of interest.

    Returns string

    The normalized representation of the keystroke.

    Notes

    This normalizes the keystroke by removing duplicate modifiers and extra primary keys, and assembling the parts in a canonical order.

    The Cmd modifier is ignored on non-Mac platforms.