Repository navigation
Unwind shifted punctuation key codes to base characters under Kitty keyboard protocol - #171
Conversation
Co-authored-by: tomlm <17789481+tomlm@users.noreply.github.com>
Perf comparison — this change, against its base3 run(s) of each side, alternating on one machine. Allocation is a count and is gated exactly. Time is a measurement, so its gate is derived from the spread this job just observed in itself rather than fixed in advance.
Each corpus is gated at assemblies measured
Perf comparison — cumulative, everything since 2.0.33 run(s) of each side, alternating on one machine. Allocation is a count and is gated exactly. Time is a measurement, so its gate is derived from the spread this job just observed in itself rather than fixed in advance.
Each corpus is gated at assemblies measured
|
Under the Kitty keyboard protocol, key events report the unshifted base character as the primary key code, carrying any shifted character in the alternate-key sub-parameter.
KittyKeyboard.GetKeyCodepreviously unwoundKeyEvent.Codeonly forDigit*andKey*prefixes, causing main-keyboard punctuation positions under Shift to fall through toev.Key[0]and emit the shifted symbol as the primary key code.Changes
Punctuation key code unwinding (
src/XTerm.NET/Input/KittyKeyboard.cs):ev.ShiftKeyis set, map the 11 main-keyboard punctuationCodevalues (Backquote,Minus,Equal,BracketLeft,BracketRight,Backslash,Semicolon,Quote,Comma,Period,Slash) to their US-positional base characters (\``,-,=,[,],`,;,',,,.,/).Digit*andKey*handlers to preserve hot-path performance for letter and digit inputs.Regression and end-to-end tests (
src/XTerm.NET.Tests/Input/):Shifted_punctuation_appears_as_a_sub_parametercovering all 11 punctuation keys withReportAlternateKeys(AllKeys | Alternates).ReportAllKeysAsEscapeCodesandCtrl+Shiftdisambiguated chords.Terminal.GenerateKittyKeyInputtest asserting mode-aware unwinding through the terminal entry point.