You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Ctrl+Esc" never matches "Ctrl+Escape" (nor Up/UpArrow, Return/Enter, Del/Delete, 1/D1): only modifier aliases are canonicalized #162
Note canonicalizes modifier aliases only (Keybinding/Models/MusicalTypes.cs:67-72, CanonicalizeKey):
"CONTROL"=> "CTRL","WIN" or "WINDOWS" or "CMD" or "COMMAND" =>"META",
_ => key
Every other key is stored exactly as typed, only uppercased, and chord equality compares those stored names. So the same physical key can be written several ways that never match each other.
Nothing in the library defines the canonical spelling either. Keybinding/Models/SpecialKeys.cs declares a public SpecialKeys enum (Escape, ArrowUp, PageUp, F1, ...), but no code references it.
Failure scenario
A user config binds "Ctrl+Esc", which is stored as notes {CTRL, ESC}.
The host builds chords from System.ConsoleKey via ToString(), so Escape becomes "Escape" and the chord is {CTRL, ESCAPE}.
ExecuteChord(Chord.Parse("Ctrl+Escape")) returns null. The binding shows in GetAllChords() but never fires, and nothing reports the mismatch.
Other spellings of the same key miss in the same way:
Up / ArrowUp (the SpecialKeys name) / UpArrow (the ConsoleKey name)
Return / Enter
Del / Delete
PgUp / PageUp
Ins / Insert
Ctrl+1 versus ConsoleKey's D1
the modifiers Option / Alt and Super / Meta
Why it matters
#107 fixed exactly this kind of silent mismatch for modifiers. Non-modifier keys are where hosts, config files and users disagree most, and the library gives them no canonical name to converge on.
Suggested fix / acceptance criteria
Extend CanonicalizeKey with an alias table that maps each key to one canonical name. At minimum:
Base the canonical names on SpecialKeys, or remove that enum if it is not meant to be public API.
Optionally, add Note.FromConsoleKey(ConsoleKey) / Chord.FromConsoleKeyInfo(ConsoleKeyInfo) so hosts get canonical chords without writing their own mapping.
Next step: Add a key alias table (Esc/Escape, Return/Enter, arrow keys, D0–D9, Option/Super), base it on SpecialKeys or remove that enum, and optionally add FromConsoleKey helpers.
Activity
matt-edmondson commentedon Sep 30, 2026
Triage
Models/MusicalTypes.CanonicalizeKey, and the unusedSpecialKeysenumD0–D9, Option/Super), base it onSpecialKeysor remove that enum, and optionally addFromConsoleKeyhelpers.Generated by Claude Code