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

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

combination
requis
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

Valeur de retour

La valeur retournée par cet util.

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

Usage

Exemples

Extraits de code prêts à coller.

Parse common combinations

typescript