splitKeySequence

Commons
stable

Parse a hotkey sequence string (e.g. "ctrl+k-p") into an array of combination strings that must be pressed in order. Validates structure and warns on invalid sequences.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

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

str
requis
string
The full sequence string. Combinations within the sequence are separated by "-". The function correctly handles literal "-" keys inside combinations.

API

Valeur de retour

La valeur retournée par cet util.

Array of combination strings (each parseable by splitKeyCombination). Returns an empty array on invalid input.

Usage

Exemples

Extraits de code prêts à coller.

Parse a chord sequence

typescript