Keep every captured key owned until its own release

Binding capture tracked one owned key, so a second capture could overwrite an
unreleased earlier choice and leak its repeats. Ownership is now a bitset over
scancodes, released per key or on focus loss, with successive-capture, release
order, cancel and focus-loss regressions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-02 16:15:54 -04:00
co-authored by Claude Opus 5.5
parent 14e676426f
commit 582d4baa20
5 changed files with 110 additions and 10 deletions
+19
View File
@@ -3831,3 +3831,22 @@ repository format check.
Limits: physical keyboards, non-US layouts and IME remain unqualified; the Apply
rehearsal is automated with synthetic events, not a manual session.
## 2026-10-02 — M9.8d follow-up (.cache/reviews/m98d-followup-review.md)
Owned capture keys are now a bounded set (bitset over SDL scancodes) instead of one
optional key, so a second capture cannot overwrite an unreleased earlier choice.
Lifecycle regressions in `capture_balances_toolkit`: W then K chosen with K released
first (W repeat/text reach neither toolkit nor world until W's release, then a
fresh W moves and reaches the toolkit); reverse release order (K stays owned after
J's release; text flows again only when nothing is owned); cancel during a second
capture keeps the first key owned; focus loss frees both; positive controls after
each. Negative check: restoring single-key ownership fails the W repeat check.
Executed: Windows MSVC client 9/9 and client-network 10/10 (final, after
formatting). Linux: clang-19 client-probe with clang-tidy (keep-going, no owned
diagnostics) CTest 13/13; Xvfb lifecycle and panels; Clang ASan/UBSan CTest 13/13
plus Xvfb lifecycle/panels; GCC 14 client-network CTest 10/10; clang-tidy app
main/panels; format check. Synthetic event sequences only: physical OS repeat with
several held keys, non-US layouts and IME remain unqualified.