shortcutFromEvent function

Module @runic-artifex/views in @runic-artifex/views 0.23.0

function shortcutFromEvent(event: ShortcutEvent, options?: ShortcutOptions): string | null;

The shortcut text that DesktopShortcut.Parse reads for a keydown event, such as Primary+Shift+S, so a page can record the key a user chooses and send it through an ordinary command; null for a press that is not a shortcut. Primary is the Command key on Apple platforms and Ctrl elsewhere, and Control is the Control key on Apple platforms. A punctuation character is recorded as typed, without Shift, as matchesShortcut reads it. Presses of a modifier alone, dead keys, input method composition, keys outside DesktopShortcut's set and, outside Apple platforms, presses with the Windows or Super key give null.