v1.1.0: SGR Mouse Event Parsing #9

Merged
amr merged 2 commits from feature/v0.11.0-slots into main 2026-05-12 18:43:20 -04:00
Showing only changes of commit d4aba6ef06 - Show all commits

View File

@@ -201,6 +201,28 @@ Checklist:
- [X] Suspend/resume-backend protocol methods (ARCHITECTURE.org spec)
- [X] Slot modes (defslot :mode parameter)
** v1.1.0: SGR Mouse Event Parsing
DONE. ~read-event~ now decodes SGR extended mouse sequences
(~ESC[<Cb;Cx;CyM/m~) into structured ~mouse-event~ structs, where previously
they fell through as ~:unknown~ key events and printed as control characters.
What was added:
- ~%read-digits~ — reads multi-digit numeric parameters from raw terminal
bytes, handling arbitrary-length values (e.g. coordinates > 99)
- ~%parse-sgr-mouse~ — full SGR mouse decoder: button code → keyword
(~:left~, ~:middle~, ~:right~, ~:scroll-up~, ~:scroll-down~, ~:drag~),
press/release detection, 1-based → 0-based coordinate conversion
- ~parse-csi-sequence~ detects the ~~<~~ marker byte (0x3C) and delegates
to ~%parse-sgr-mouse~ instead of treating the sequence as keyboard input
The mouse enable/disable sequences were already sent by
~initialize-backend~/~shutdown-backend~ (lines 126-128, 139-141 of
~modern.lisp~). The parsing gap was the only missing piece.
Test coverage: 461 unit tests + 32 integration tests, all at 100%.
Org source: ~org/text-input.org~ (tangled to ~src/components/input.lisp~).
** Feature Reference
| Phase | Component | Lines | Release | Status |