GameInput: merge overlapping holds from VICTORY_KEYS #2499

Closed
github-bot wants to merge 1 commit from gh-pr/2499/head into gh-pr/2499/base
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 14:52 UTC · original
andrewpozdnakov7-jpg:codex2/scripted-key-overlap → main · +53 −8 · 1 files · 1 commits · closed without merging

VICTORY_KEYS holds each scheduled key for 200 ms. When two events for the same key overlap, the keyboard reading currently contains two copies of that key. The end of the earlier event can also change the ordering of still-held keys.

Build continuous hold intervals once at startup. Overlapping and touching intervals for the same key share one hold, in scheduled press order. A real gap still allows the key to be released and pressed again.

The same synthetic schedule returns A, B, A halfway through the overlap on 940d32f and A, B with this change. It also checks that A, B stays in order past the earlier event's end, that the keys are released at the end of their holds, and that a later A becomes a separate press. The 10 GameInput tests, strict HLE Clippy with diagnostics, and staged asset policy passed on Windows.

Coordination claim

Please retain the Git author when cherry-picking or rebasing. If you fold the change into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 14:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/2499) `andrewpozdnakov7-jpg:codex2/scripted-key-overlap` → `main` · +53 −8 · 1 files · 1 commits · closed without merging `VICTORY_KEYS` holds each scheduled key for 200 ms. When two events for the same key overlap, the keyboard reading currently contains two copies of that key. The end of the earlier event can also change the ordering of still-held keys. Build continuous hold intervals once at startup. Overlapping and touching intervals for the same key share one hold, in scheduled press order. A real gap still allows the key to be released and pressed again. The same synthetic schedule returns `A, B, A` halfway through the overlap on `940d32f` and `A, B` with this change. It also checks that `A, B` stays in order past the earlier event's end, that the keys are released at the end of their holds, and that a later `A` becomes a separate press. The 10 GameInput tests, strict HLE Clippy with diagnostics, and staged asset policy passed on Windows. [Coordination claim](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633) Please retain the Git author when cherry-picking or rebasing. If you fold the change into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:07:33 +00:00
github-bot closed this pull request 2026-11-26 05:07:33 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:55 UTC · original

Automated triage for the maintainers. Recommended for a look (not an approval).

In crates/victory-hle/src/modules/gameinput.rs (diagnostics-only VICTORY_KEYS path), scripted() returned one entry per overlapping event, so Host::keys() could report the same key twice in one keyboard reading. The PR builds merged hold intervals once (scheduled_key_holds) and reads them with scripted_at; I checked the merge logic and the test's expected timings (overlap merged, end exclusive, a later press after a gap is separate). Small and contained to the diagnostics feature; CI (check) is passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/2499#issuecomment-7167430457) <!-- victory-triage v1 head=6741d9e9ed2f11f2a78342e5ee402fe62b51217c verdict=merge-candidate at=2026-11-25T15:53:31Z --> Automated triage for the maintainers. Recommended for a look (not an approval). In `crates/victory-hle/src/modules/gameinput.rs` (diagnostics-only `VICTORY_KEYS` path), `scripted()` returned one entry per overlapping event, so `Host::keys()` could report the same key twice in one keyboard reading. The PR builds merged hold intervals once (`scheduled_key_holds`) and reads them with `scripted_at`; I checked the merge logic and the test's expected timings (overlap merged, end exclusive, a later press after a gap is separate). Small and contained to the diagnostics feature; CI (`check`) is passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:10 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because the duplicates it merges change nothing: they arise only when a script schedules the same key twice within 0.2 s, and the title ORs key states into its table. It rewrites the same scripted() as #2205 (per-entry hold lengths) and would have to be redone on top of that.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 22:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/2499#issuecomment-7176026232) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because the duplicates it merges change nothing: they arise only when a script schedules the same key twice within 0.2 s, and the title ORs key states into its table. It rewrites the same `scripted()` as #2205 (per-entry hold lengths) and would have to be redone on top of that. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2499
No description provided.