Repository navigation
Fold browser and Silk.NET letter and digit key names into the plain key [patch] - #219
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
…ey [patch] Browsers send KeyA-KeyZ and Digit0-Digit9 (KeyboardEvent.code) and Silk.NET sends Number0-Number9, so `ControlLeft+KeyS` parsed as `Ctrl+KEYS` and never matched a stored `Ctrl+S`. CanonicalizeKey now folds these next to the WinForms D0-D9 rule. Numpad and keypad names stay distinct. Fixes #218 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW26R7a4LaEL6NnFvBq
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #218
What changed
#205 taught
CanonicalizeKeythe modifier names that browsers and Silk.NET send, but not their letter and digit names. SoControlLeft+KeySbecameCtrl+KEYSand never matched a storedCtrl+S.CanonicalizeKey(Keybinding/Models/MusicalTypes.cs) now folds these, next to the existing WinFormsD0-D9rule:KEYplus exactly one letter (browserKeyA-KeyZ) folds to the letterDIGITplus one digit (browserDigit0-Digit9) andNUMBERplus one digit (Silk.NETNumber0-Number9) fold to the digitNumpad names (
Numpad1,NumPad1,Keypad1) stay distinct. So do near-misses such asKey1,KeyAB,Digit10andNumberA.Tests
ChordParse_KeyAliasesMatchCanonicalNamehas new rows forKeyA/KeyS/KeyZ,Digit0/1/9andNumber0/1/9. Each checks equality, the hash, and theNoteNameconstructor.ChordParse_BrowserAndSilkKeyNames_DisplayAsCanonicalChordcovers the issue's cases:ControlLeft+KeySequalsCtrl+Sand displays asCtrl+S, and the same forDigit1andNumber1.NoteConstructor_OtherKeyNamesStayDistinctchecks that the numpad names and near-misses are left as they are.With the fix reverted, 13 of the new cases fail. With it, the full suite passes (405/405).
Generated by Claude Code