ChemPal Documentation - v1.6.0
    Preparing search index...

    Function parseSequence

    • 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.

      Parameters

      • binding: string

        The sequence binding string. Tokens are case-insensitive.

      Returns string[]

      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);
      }