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

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

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

API

Return value

The value returned by this util.

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

Usage

Examples

Ready-to-paste usage snippets.

Parse a chord sequence

typescript