The sequence binding string. Tokens are case-insensitive.
The ordered, normalized keys the user must press in turn.
parseSequence("up+up+down+down+left+right");
// => ["arrowup", "arrowup", "arrowdown", "arrowdown", "arrowleft", "arrowright"]
export function parseSequence(binding: string): string[] {
return binding
.split('+')
.map((t) => t.trim())
.filter(Boolean)
.map(normalizeKey);
}
Parses a sequential binding string such as
"up+up+down+down+left+right"into an ordered array of normalized keys. Unlike parseBinding, every token is a key in the sequence — there are no modifiers.