Parses a keyboard shortcut string like 'ctrl+shift+k' or 'mod+b' into a structured {@link KeyCombo}
parseKeyCombo
Functioncore/utils/keyboard
projects/core/utils/keyboard.util.ts
Description#
Parses a keyboard shortcut string like 'ctrl+shift+k' or 'mod+b' into
a structured KeyCombo.
The mod modifier resolves to meta on macOS and ctrl elsewhere.
Modifier names are case-insensitive.
const combo = parseKeyCombo('mod+b');
// { key: 'b', ctrl: false, meta: false, mod: true, shift: false, alt: false }