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
ImGui key names aren't canonicalized: LeftCtrl+Key1 shows as Ctrl+KEY1 and ModCtrl+S as MODCTRL+S, so neither equals Ctrl+1 / Ctrl+S #224
The comment above the modifier switch in Note.CanonicalizeKey (Keybinding/Models/MusicalTypes.cs, ~L66–120) says it accepts ImGui names. It only covers ImGui's left/right modifier keys (LeftCtrl, LeftSuper, …). Hexa.NET.ImGui, which ktsu's ImGui stack uses, spells two other groups of keys differently. Neither group is folded.
Main-row digits are ImGuiKey.Key0 … Key9.
Modifier flags used with ImGui's chord API (IsKeyChordPressed(ImGuiKey.ModCtrl | ImGuiKey.S)) are ModCtrl, ModShift, ModAlt and ModSuper.
These names were confirmed by reflecting over ImGuiKey in Hexa.NET.ImGui 2.2.9.
Repro, using a console app that references Keybinding.csproj at 89f14b9:
GLFW has the same gap. #209 accepted GLFW's snake_case modifier names (LEFT_CONTROL, LEFT_SUPER), but GLFW's other multi-word keys are not folded:
LEFT_CONTROL+PAGE_UP shows as Ctrl+PAGE_UP, and Equals(Ctrl+PageUp) is false.
CAPS_LOCK and PRINT_SCREEN behave the same way.
By reading the code, PAGE_DOWN, NUM_LOCK and SCROLL_LOCK would too.
Why it matters
An ImGui host that builds chords from ImGuiKey.ToString() never matches stored bindings such as Ctrl+1 or Ctrl+S, and it shows unreadable names in the UI. This is the #205/#218 symptom again, reached through a framework the code says it supports.
#218 covers the browser and Silk.NET spellings (KeyS, Digit1), not these. PR #219's test NoteConstructor_OtherKeyNamesStayDistinct has [DataRow("Key1")], which asserts that Key1 stays KEY1. Merging that test as written would lock this bug in. The fix here should flip that row to expect 1, while Keypad1/Numpad1 stay distinct.
Suggested fix / acceptance criteria
Fold KEY<digit> (exactly four characters, last one 0–9) to the digit.
LeftCtrl+Key1 equals Ctrl+1.
Map the ImGui modifier flags:
MODCTRL → CTRL
MODSHIFT → SHIFT
MODALT → ALT
MODSUPER → META
Map the GLFW multi-word names to the canonical names already used for other frameworks: PAGE_UP, PAGE_DOWN, CAPS_LOCK, NUM_LOCK, SCROLL_LOCK, PRINT_SCREEN.
Next step: fold KEY<digit>, map MODCTRL/MODSHIFT/MODALT/MODSUPER to CTRL/SHIFT/ALT/META, map the six GLFW snake_case names to the existing canonical names, and add equality tests for every input listed in the issue.
Activity
matt-edmondson commentedon Nov 5, 2026
Triage
ImGuiKey.ToString()never match stored digit bindings (Ctrl+1) or chord-flag bindings (Ctrl+Sarriving asModCtrl+S), and the UI shows unreadable names for them. The code comment says ImGui is supported, and this is the same symptom as Letter and digit keys named the browserKeyboardEvent.code/ Silk.NET way aren't canonicalized:ControlLeft+KeySshows asCtrl+KEYSand never equalsCtrl+S#218, which was rated High for browser and Silk.NET hosts. The GLFW multi-word names (PAGE_UP,CAPS_LOCK, …) have the same gap.Note.CanonicalizeKeyinKeybinding/Models/MusicalTypes.cs). Assign it to the owner of Letter and digit keys named the browserKeyboardEvent.code/ Silk.NET way aren't canonicalized:ControlLeft+KeySshows asCtrl+KEYSand never equalsCtrl+S#218 / PR Fold browser and Silk.NET letter and digit key names into the plain key [patch] #219, since both changes edit the same switch.ControlLeft+Cnever equalsCtrl+Cand displays asC+CONTROLLEFT#205 and Fold browser, Silk.NET, ImGui, GLFW and macOS modifier names into Ctrl, Alt, Shift and Meta [patch] #209 (closed) covered modifier names, and Letter and digit keys named the browserKeyboardEvent.code/ Silk.NET way aren't canonicalized:ControlLeft+KeySshows asCtrl+KEYSand never equalsCtrl+S#218 covers browser and Silk.NET letter and digit names.NoteConstructor_OtherKeyNamesStayDistincthas[DataRow("Key1")], which asserts thatKey1staysKEY1. If Fold browser and Silk.NET letter and digit key names into the plain key [patch] #219 merges as written, it locks in this bug. Either drop or flip that row in Fold browser and Silk.NET letter and digit key names into the plain key [patch] #219 before it merges, or flip it here as part of this fix (Key1→1, whileKeypad1andNumpad1stay distinct).KEY<digit>, mapMODCTRL/MODSHIFT/MODALT/MODSUPERtoCTRL/SHIFT/ALT/META, map the six GLFW snake_case names to the existing canonical names, and add equality tests for every input listed in the issue.Generated by Claude Code