Parses a keyboard shortcut string like 'ctrl+shift+k' or 'mod+b' into a structured {@link KeyCombo}
parseKeyCombo
Functioncore/utils/keyboardv0.1.0
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.
A trailing + names the literal plus key: 'mod++' parses as
mod + '+' (the split's trailing empty segment is the key, not a
dangling separator).
const combo = parseKeyCombo('mod+b');
// { key: 'b', ctrl: false, meta: false, mod: true, shift: false, alt: false }