(input: string)
| 78 | * Parse a chord string like "ctrl+k ctrl+s" into an array of ParsedKeystrokes. |
| 79 | */ |
| 80 | export function parseChord(input: string): Chord { |
| 81 | // A lone space character IS the space key binding, not a separator |
| 82 | if (input === ' ') return [parseKeystroke('space')] |
| 83 | return input.trim().split(/\s+/).map(parseKeystroke) |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Convert a ParsedKeystroke to its canonical string representation for display. |
no test coverage detected