function parseKeyboardEvent(event, platform?): ParsedHotkeyChord;Defined in: parse.ts:308
Parses a KeyboardEvent into the chord it pressed, in the same format as parseHotkey(). Pass the result to normalizeHotkey for its canonical string.
KeyboardEvent
The KeyboardEvent to parse
Platform
The target platform for resolving modifiers (defaults to auto-detection)
The parsed chord for the keyboard event
document.addEventListener('keydown', (event) => {
const parsed = parseKeyboardEvent(event)
console.log(parsed) // { key: 'S', ctrl: true, shift: false, ... }
})