splitKeyCombination

Commons
stable

Parse a single hotkey combination string (e.g. "ctrl+k") into an array of individual key names. Validates structure and warns on invalid input.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

combination
required
string
The combination string to parse, e.g. "ctrl+shift+k". Keys are separated by "+" or "_". A single "-" is treated as a literal key within a combination.
isInternal
boolean
false
When true, suppresses consoleWarn calls on invalid input. Used by the hotkey system when parsing partially-typed sequences.

API

Return value

The value returned by this util.

Array of normalised key name strings. Returns an empty array when the input is empty or structurally invalid.

Usage

Examples

Ready-to-paste usage snippets.

Parse common combinations

typescript