d3d12 gameinput: LEONIDA_KBM_BINDS remaps keyboard and mouse binds without a rebuild (D3D12-KBM-BINDS) #3276

Manually merged
github merged 3 commits from github-bot/gh-3276 into gh-pr/3276/base 2026-12-03 03:20:15 +00:00 AGit
Owner

@⁠OreoFR on GitHub · 2026-12-03 01:51 UTC · original
OreoFR:feat/kbm-binds → main · +660 −41 · 4 files · 3 commits · merged 2026-12-03 03:13 UTC

Item: D3D12-KBM-BINDS (claimed in #2570). Players asked for it on Discord: they wanted to remap keys and could not find which key gives Square.

What changes

LEONIDA_KBM_BINDS=scope:key=action;... changes the keyboard and mouse binds of the GTA V layout without a rebuild.

  • scope is foot, vehicle or both.
  • key is a letter, a digit or a name: Space, LShift, Numpad8, F5, MouseLeft...
  • action is a pad input: A/Cross, Square, RB, LT, DpadUp, LeftY+..., or none.

Example: both:G=Square;both:R=none;foot:V=RB.

  • An entry replaces every default bind of its key in its scope, and several keys may give one action.
  • The two tables are built once (LazyLock) from the consts plus the entries. The stand-in pad, outputs and the hand-over rule (changes) all read the built tables. So when a remapped key gives another input in a vehicle than on foot, it waits for a fresh press after a change of table.
  • Entries that do not read are skipped with one warning each, naming the entry; nothing panics. The same goes for the runtime's own keys: F1 settings menu, F3 numbers panel, F4 trainer, F8 ped dump, F9 frame capture, Alt and Caps Lock.
  • Unset, the tables are the consts, bind for bind (tested over all 256 keys). LEONIDA_KBM=classic does not read the variable.
  • Docs: docs/gameinput.md (section "Your own binds") documents the syntax and the default keys, and d3d12/README.md has a pointer. d3d12/docs/switches.md is regenerated.

Tested

In game on an RTX 4070 Laptop 8 GB, driver 621.40, Windows 11.

  • Build: leonida.exe from 94950d4a5 (origin/main 1a163523d + this change), diag profile. git merge-tree against the current main d15e048a7 is clean.

  • Recipe: the standard walking gate:

    • a fresh data copy;
    • -SeriesS -NoDlss -NoFrameGen -PrecompileUsed;
    • BAR 0 and a texture budget of 1024;
    • W plus J/L turns from the keys file;
    • 330 s in the world.
  • Run 1, binds set: LEONIDA_KBM_BINDS='both:R=none;both:G=Square;foot:V=RB;bogus=entry;both:F1=A'.

    • The log has the info line (applied, 2 skipped; 31 binds on foot, 35 in a vehicle).
    • Exactly two warnings: bogus=entry (no scope) and both:F1=A (the runtime's own key).
    • 0 device lost or removed, 0 errors, clean close. 25.5 fps / 39.2 ms over the last 240 s.
    • Scripted G and R presses were sent once in the world, standing still.
  • Run 2, control (variable unset): no binds lines, 0 device lost or removed, 0 errors, clean close. 27.5 fps / 36.4 ms over the last 240 s.

What could not be observed in game:

  • The pad buttons the stand-in pad produces are not logged. The scripted keys do go through the remapped tables, but whether G now gives Square and R nothing could not be seen in the log or on screen.
  • In both runs the end view of the walk was the same, so the walk did not visibly move the player in this start scene. That happened with and without the variable, so it is not a difference between the runs.
  • A check by hand (press G on foot and see the Square action) would close this.

Unit tests:

  • cargo test -p leonida-hle: 257 passed, 2 ignored.
  • cargo clippy -p leonida-hle --all-targets -- -D warnings: clean.
  • Counter-tests:
    • keeping the default binds of a named key fails 3 of the new tests;
    • running the hand-over on the default tables fails the remapped hand-over test.

Follow-up planned: a Controls page in the launcher that writes this variable.

AI-assisted (oreofr-agent, Claude Code).

🤖 Generated with Claude Code

**@⁠OreoFR** on GitHub · 2026-12-03 01:51 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276) `OreoFR:feat/kbm-binds` → `main` · +660 −41 · 4 files · 3 commits · merged 2026-12-03 03:13 UTC Item: **D3D12-KBM-BINDS** (claimed in #2570). Players asked for it on Discord: they wanted to remap keys and could not find which key gives Square. ## What changes `LEONIDA_KBM_BINDS=scope:key=action;...` changes the keyboard and mouse binds of the GTA V layout without a rebuild. - **scope** is `foot`, `vehicle` or `both`. - **key** is a letter, a digit or a name: `Space`, `LShift`, `Numpad8`, `F5`, `MouseLeft`... - **action** is a pad input: `A`/`Cross`, `Square`, `RB`, `LT`, `DpadUp`, `LeftY+`..., or `none`. Example: `both:G=Square;both:R=none;foot:V=RB`. - An entry replaces every default bind of its key in its scope, and several keys may give one action. - The two tables are built once (`LazyLock`) from the consts plus the entries. The stand-in pad, `outputs` and the hand-over rule (`changes`) all read the built tables. So when a remapped key gives another input in a vehicle than on foot, it waits for a fresh press after a change of table. - Entries that do not read are skipped with one warning each, naming the entry; nothing panics. The same goes for the runtime's own keys: F1 settings menu, F3 numbers panel, F4 trainer, F8 ped dump, F9 frame capture, Alt and Caps Lock. - Unset, the tables are the consts, bind for bind (tested over all 256 keys). `LEONIDA_KBM=classic` does not read the variable. - Docs: `docs/gameinput.md` (section "Your own binds") documents the syntax and the default keys, and `d3d12/README.md` has a pointer. `d3d12/docs/switches.md` is regenerated. ## Tested In game on an RTX 4070 Laptop 8 GB, driver 621.40, Windows 11. - **Build:** leonida.exe from 94950d4a5 (origin/main 1a163523d + this change), diag profile. `git merge-tree` against the current main d15e048a7 is clean. - **Recipe:** the standard walking gate: - a fresh data copy; - `-SeriesS -NoDlss -NoFrameGen -PrecompileUsed`; - BAR 0 and a texture budget of 1024; - W plus J/L turns from the keys file; - 330 s in the world. - **Run 1, binds set:** `LEONIDA_KBM_BINDS='both:R=none;both:G=Square;foot:V=RB;bogus=entry;both:F1=A'`. - The log has the info line (applied, 2 skipped; 31 binds on foot, 35 in a vehicle). - Exactly two warnings: `bogus=entry` (no scope) and `both:F1=A` (the runtime's own key). - 0 device lost or removed, 0 errors, clean close. 25.5 fps / 39.2 ms over the last 240 s. - Scripted G and R presses were sent once in the world, standing still. - **Run 2, control** (variable unset): no binds lines, 0 device lost or removed, 0 errors, clean close. 27.5 fps / 36.4 ms over the last 240 s. What could not be observed in game: - The pad buttons the stand-in pad produces are not logged. The scripted keys do go through the remapped tables, but whether G now gives Square and R nothing could not be seen in the log or on screen. - In both runs the end view of the walk was the same, so the walk did not visibly move the player in this start scene. That happened with and without the variable, so it is not a difference between the runs. - A check by hand (press G on foot and see the Square action) would close this. Unit tests: - `cargo test -p leonida-hle`: 257 passed, 2 ignored. - `cargo clippy -p leonida-hle --all-targets -- -D warnings`: clean. - Counter-tests: - keeping the default binds of a named key fails 3 of the new tests; - running the hand-over on the default tables fails the remapped hand-over test. Follow-up planned: a Controls page in the launcher that writes this variable. AI-assisted (oreofr-agent, Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`LEONIDA_KBM_BINDS=scope:key=action;...` (scope foot, vehicle or both; key a
letter, digit or name such as Space, LShift, Numpad8, F5, MouseLeft; action a
pad input such as A, Square, RB, LT, DpadUp, LeftY+, or none) changes the
GTA V layout's two tables. An entry replaces every default bind of its key in
its scope; several keys may give one action. The tables are built once
(LazyLock) from the consts plus the entries, and the stand-in pad, `outputs`
and the hand-over rule (`changes`) all read the built tables, so a remapped key
that ends up another input in a vehicle than on foot waits for a fresh press
after a change of table.

Entries that do not read, and the runtime's own keys (F1 settings menu, F3
numbers panel, F4 trainer menu, F8 ped dump, F9 frame capture, Left/Right Alt,
Caps Lock), are skipped with one warning each naming the entry; nothing
panics. Unset, the tables are the consts bind for bind (tested over all 256
keys); LEONIDA_KBM=classic does not read the variable.

Tests: cargo test -p leonida-hle (257 passed, 2 ignored), clippy -p
leonida-hle --all-targets -D warnings clean; a counter-test that keeps the
default binds of a named key fails 3 of the new tests, one that runs the
hand-over on the default tables fails the remapped hand-over test.
docs/gameinput.md documents the syntax; d3d12/docs/switches.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 01:58:16 +00:00
Author
Owner

@⁠fiestorra on GitHub · 2026-12-03 01:57 UTC · original

VERIFY-3276 — Windows nativo: LEONIDA_KBM_BINDS lee, y el control muerde

Own commit 94950d4a5 — gameinput/kbm.rs (+531), docs/gameinput.md (+34), d3d12/docs/switches.md, README

Ran at the head

cargo test -p leonida-hle --lib kbm     20 passed; 0 failed
  kbm::tests::unset_binds_are_the_default_tables ... ok
  kbm::tests::bind_entries_read ... ok

Negative control (synthetic): I made the parser honour only the first semicolon-separated entry (.take(1) on the split), rebuilt and ran:

FAILED. 17 passed; 3 failed
assertion `left == right` failed

Three of the twenty bite — which is the right proportion for a parser: one entry alone, several entries, and the default table when the switch is unset are three different promises.

What the change is: LEONIDA_KBM_BINDS gives keyboard and mouse binds without a rebuild — a list of entries, each with a scope, parsed by entry(text), with anything that does not parse skipped and reported rather than failing the list (skipped.push(format!("LEONIDA_KBM_BINDS: {text} skipped: …"))).

And that design decision is the one worth naming: a modder's typo in one bind does not take the other eleven with it, and the line says which one was dropped. It is the same rule as the input tape's malformed lines (#3119) and the same one the switches.md check applies to its own rows — skip and count, never fail silently, never fail all.

What I could not test

  • A bind actually driving the game: that needs the title and a keyboard; the tests drive the parser and the tables it produces.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-12-03 01:57 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#issuecomment-7364921981) ## VERIFY-3276 — Windows nativo: `LEONIDA_KBM_BINDS` lee, y el control muerde | | | |---|---| | Own commit | `94950d4a5` — `gameinput/kbm.rs` (+531), `docs/gameinput.md` (+34), `d3d12/docs/switches.md`, `README` | **Ran at the head** ``` cargo test -p leonida-hle --lib kbm 20 passed; 0 failed kbm::tests::unset_binds_are_the_default_tables ... ok kbm::tests::bind_entries_read ... ok ``` **Negative control (synthetic)**: I made the parser honour **only the first** semicolon-separated entry (`.take(1)` on the split), rebuilt and ran: ``` FAILED. 17 passed; 3 failed assertion `left == right` failed ``` **Three of the twenty bite** — **which is the right proportion for a parser: one entry alone, several entries, and the default table when the switch is unset are three different promises.** **What the change is**: **`LEONIDA_KBM_BINDS` gives keyboard and mouse binds without a rebuild** — **a list of entries, each with a scope, parsed by `entry(text)`, with anything that does not parse *skipped and reported* rather than failing the list** (`skipped.push(format!("LEONIDA_KBM_BINDS: `{text}` skipped: …"))`). **And that design decision is the one worth naming**: **a modder's typo in one bind does not take the other eleven with it, and the line says which one was dropped.** **It is the same rule as the input tape's malformed lines (`#3119`) and the same one the `switches.md` check applies to its own rows** — **skip and count, never fail silently, never fail all.** ## What I could not test - **A bind actually driving the game**: that needs the title and a keyboard; **the tests drive the parser and the tables it produces.** Written with an AI assistant.
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-03 01:58 UTC · original · reviewed

Rechecked 94950d4a merged onto d15e048a. All 20 stock keyboard-binding tests passed in the Windows MSVC test build under Wine 11.22. Four extra synthetic cases exposed two gaps.

  • Reject out-of-range key numbers before doing arithmetic. With debug overflow checks, invalid names such as F144 and Numpad160 panic inside key_named() before entry() reports an unknown key. then_some() evaluates the addition even when its range check is false. Both extra parse tests passed when I changed the two branches to lazy .then(|| ...); the following valid binding was still applied.
  • The manual vehicle fallback still treats physical F as exit. After Caps Lock selects the vehicle table with context unknown, vehicle:F=RB leaves driving mode and produces no RB when F is pressed. The same binding produces RB with measured vehicle context. With F mapped to RB and G mapped to Y in both tables, G generates Y and leaves manual driving selected. If manual exit follows the remap, make sure the vehicle's exit action is emitted before switching tables, especially for a key whose binding differs between them.

Merge-order note for #3270: the only conflict is the generated catalog. Keeping this PR's regenerated 684-entry document with #3270's checker passed --check and all 21 catalog tests. These were synthetic checks. AI-assisted with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-12-03 01:58 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#pullrequestreview-6162396357) · **reviewed** Rechecked `94950d4a` merged onto `d15e048a`. All 20 stock keyboard-binding tests passed in the Windows MSVC test build under Wine 11.22. Four extra synthetic cases exposed two gaps. - **Reject out-of-range key numbers before doing arithmetic.** With debug overflow checks, invalid names such as `F144` and `Numpad160` panic inside `key_named()` before `entry()` reports an unknown key. `then_some()` evaluates the addition even when its range check is false. Both extra parse tests passed when I changed the two branches to lazy `.then(|| ...)`; the following valid binding was still applied. - **The manual vehicle fallback still treats physical F as exit.** After Caps Lock selects the vehicle table with context unknown, `vehicle:F=RB` leaves driving mode and produces no RB when F is pressed. The same binding produces RB with measured vehicle context. With F mapped to RB and G mapped to Y in both tables, G generates Y and leaves manual driving selected. If manual exit follows the remap, make sure the vehicle's exit action is emitted before switching tables, especially for a key whose binding differs between them. Merge-order note for #3270: the only conflict is the generated catalog. Keeping this PR's regenerated 684-entry document with #3270's checker passed `--check` and all 21 catalog tests. These were synthetic checks. AI-assisted with OpenAI Codex.
merzleckeier's review of 94950d4a5:
- key_named used `then_some(VK_F1 + n - 1)` and `then_some(VK_NUMPAD0 +
  digit)`, which add before the range check: F144 or Numpad160 overflowed u8
  (a panic with overflow checks) instead of an "unknown key" warning. Now
  `then(|| ...)`.
- With no context measured, Caps Lock's driving table ended on the physical
  F, so `vehicle:F=RB` left driving and gave no RB. It now ends on a key just
  pressed that is the pad's Y in the driving table (F unless remapped;
  Binds::exit_pressed). A key that is Y on foot too switches at once, as F
  did; one that is another input on foot keeps the driving table while held
  (`leaving`), so its Y reaches the title, and the on-foot table comes when
  it is let go. Caps Lock or a measured context drops `leaving`.

Tests: four out-of-range names in bind_entries_read (F144, F255,
Numpad160, Num250); leaving_a_vehicle_by_hand_follows_the_remap
(vehicle:F=RB stays RB and driving; both:G=Y leaves at once with Y; G Y in a
vehicle and RB on foot holds Y until let go, then on-foot W is the stick and
G is RB; Caps Lock while leaving drops it). cargo test -p leonida-hle 258
passed, 2 ignored; clippy -D warnings clean. With the old then_some and the
physical-F rule both tests fail (overflow panic, vehicle:F=RB leaving).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠MoonEyes on GitHub · 2026-12-03 02:17 UTC · original

RUN (in game, batch of two pull requests), each head merged with git merge --no-ff onto main d15e048a7, in one build: #3275 ec94ceb00, #3276 94950d4a5. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, -PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
Rendered fps, last 240 s (48 samples) median 16.8, mean 16.9
Rendered fps, last 120 s median 17.0
Time under 5 fps in the world 0 %

For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.

Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.

Limits: one run; arrival in the world was driven by keys and not checked on pictures; -PrecompileUsed was used, so the default start (every known pipeline precompiled) was not exercised. #3275 changes how copy-back work is assigned; whether it saves time was not measured here (one run, no A/B), only that nothing fell over. #3276's new keyboard and mouse binds were not exercised: the run's input was the default key route, so it covers the default path only.

AI-assisted (Claude Code).

**@⁠MoonEyes** on GitHub · 2026-12-03 02:17 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#issuecomment-7365298363) RUN (in game, batch of two pull requests), each head merged with `git merge --no-ff` onto main `d15e048a7`, in one build: #3275 `ec94ceb00`, #3276 `94950d4a5`. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, `-PrecompileUsed`, the same walking route as the other runs on this machine, 330 s after reaching the world. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | Rendered fps, last 240 s (48 samples) | median 16.8, mean 16.9 | | Rendered fps, last 120 s | median 17.0 | | Time under 5 fps in the world | 0 % | For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain. Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it. Limits: one run; arrival in the world was driven by keys and not checked on pictures; `-PrecompileUsed` was used, so the default start (every known pipeline precompiled) was not exercised. #3275 changes how copy-back work is assigned; whether it saves time was not measured here (one run, no A/B), only that nothing fell over. #3276's new keyboard and mouse binds were not exercised: the run's input was the default key route, so it covers the default path only. AI-assisted (Claude Code).
Author
Owner

@⁠OreoFR on GitHub · 2026-12-03 02:27 UTC · original

Thanks @⁠merzleckeier. Both are fixed in c179023f9.

  • Overflow. key_named now uses then(|| ...), so F144, F255, Numpad160 and Num250 are an "unknown key" warning, not a u8 overflow. All four are in bind_entries_read.
  • Manual vehicle exit. With no context measured, the driving table now ends on a key just pressed that is the pad's Y in the driving table (Binds::exit_pressed): F unless remapped.
    • A key that is Y on foot too switches at once, as F did.
    • A key that is another input on foot keeps the driving table while it is held (leaving): its Y reaches the title first, and the on-foot table comes when it is let go.
    • Caps Lock, or a measured context, drops leaving.
    • leaving_a_vehicle_by_hand_follows_the_remap covers your cases:
      • vehicle:F=RB gives RB and stays driving;
      • both:F=RB;both:G=Y: G leaves at once with Y, and F stays RB;
      • G is Y in a vehicle and RB on foot: Y is held until G is let go, then W is the stick and G is RB;
      • Caps Lock while leaving.
  • cargo test -p leonida-hle: 258 passed, 2 ignored. clippy -D warnings: clean.
  • Counter-test: with the old then_some and the physical-F rule, both tests fail (an overflow panic, and vehicle:F=RB leaving).

Thanks for the #3270 merge-order note.

(oreofr-agent, AI-assisted)

**@⁠OreoFR** on GitHub · 2026-12-03 02:27 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#issuecomment-7365481923) Thanks @⁠merzleckeier. Both are fixed in c179023f9. - **Overflow.** `key_named` now uses `then(|| ...)`, so `F144`, `F255`, `Numpad160` and `Num250` are an "unknown key" warning, not a u8 overflow. All four are in `bind_entries_read`. - **Manual vehicle exit.** With no context measured, the driving table now ends on a key just pressed that is the pad's Y in the *driving* table (`Binds::exit_pressed`): F unless remapped. - A key that is Y on foot too switches at once, as F did. - A key that is another input on foot keeps the driving table while it is held (`leaving`): its Y reaches the title first, and the on-foot table comes when it is let go. - Caps Lock, or a measured context, drops `leaving`. - `leaving_a_vehicle_by_hand_follows_the_remap` covers your cases: - `vehicle:F=RB` gives RB and stays driving; - `both:F=RB;both:G=Y`: G leaves at once with Y, and F stays RB; - G is Y in a vehicle and RB on foot: Y is held until G is let go, then W is the stick and G is RB; - Caps Lock while leaving. - `cargo test -p leonida-hle`: 258 passed, 2 ignored. `clippy -D warnings`: clean. - Counter-test: with the old `then_some` and the physical-F rule, both tests fail (an overflow panic, and `vehicle:F=RB` leaving). Thanks for the #3270 merge-order note. (oreofr-agent, AI-assisted)
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-03 02:32 UTC · original · reviewed

Verified c179023f merged onto d15e048a. All 21 stock keyboard tests passed in the Windows MSVC build under Wine 11.22, with overflow checks enabled. The four independent probes from my earlier review passed too.

[P2] Keep manual driving when the exit tap is suppressed by the hand-over pause. With vehicle:G=Y;foot:G=RB and unknown context, I entered manual driving with Caps Lock at 0 ms, then pressed G at 16 ms and released it at 24 ms. Both G polls returned a neutral pad, but on release the driver moved to the on-foot table. leaving is armed from the raw key press at kbm.rs:702–705, while the 400 ms pause filters out that key at the final pad mapping (kbm.rs:732–734). The release branch switches tables even though Y was never sent. Holding G through the pause sends Y correctly and should still switch on release.

I recorded when the pending exit key actually contributed Y to the pad in a disposable variant. A suppressed tap kept the vehicle table, a held press still exited once Y had been sent, and all 27 keyboard tests and probes passed. Synthetic input only. AI-assisted with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-12-03 02:32 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#pullrequestreview-6162699549) · **reviewed** Verified `c179023f` merged onto `d15e048a`. All 21 stock keyboard tests passed in the Windows MSVC build under Wine 11.22, with overflow checks enabled. The four independent probes from my earlier review passed too. **[P2] Keep manual driving when the exit tap is suppressed by the hand-over pause.** With `vehicle:G=Y;foot:G=RB` and unknown context, I entered manual driving with Caps Lock at 0 ms, then pressed G at 16 ms and released it at 24 ms. Both G polls returned a neutral pad, but on release the driver moved to the on-foot table. `leaving` is armed from the raw key press at `kbm.rs:702–705`, while the 400 ms pause filters out that key at the final pad mapping (`kbm.rs:732–734`). The release branch switches tables even though Y was never sent. Holding G through the pause sends Y correctly and should still switch on release. I recorded when the pending exit key actually contributed Y to the pad in a disposable variant. A suppressed tap kept the vehicle table, a held press still exited once Y had been sent, and all 27 keyboard tests and probes passed. Synthetic input only. AI-assisted with OpenAI Codex.
merzleckeier's review of c179023f9: with vehicle:G=Y;foot:G=RB and no
context, a G tapped inside the 400 ms pause after Caps Lock gave a neutral
pad (the pause holds back keys that change with the table), yet letting it
go switched to the on-foot table: `leaving` was armed from the raw press.
Now `leaving_sent` records that the key counted in a driving pad (its Y
sent); letting it go switches only then, otherwise driving by hand goes on.
Holding it through the pause sends Y and switches on release as before.

Tests: leaving_a_vehicle_by_hand_follows_the_remap gains the swallowed tap
(still driving, leaving cleared) and the held press (Y, then on foot).
cargo test -p leonida-hle 258 passed, 2 ignored; clippy -D warnings clean.
With the release switching unconditionally the test fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠OreoFR on GitHub · 2026-12-03 02:44 UTC · original

Thanks @⁠merzleckeier, fixed in 2ab7c60e8. leaving_sent records that the leaving key counted in a driving pad, i.e. its Y was sent. Letting the key go switches to the on-foot table only then. A tap the hand-over pause swallowed keeps driving by hand and clears leaving; a press held through the pause sends Y and switches on release. Your tap case and the held press are both in leaving_a_vehicle_by_hand_follows_the_remap. cargo test -p leonida-hle: 258 passed. clippy: clean. With the release switching unconditionally, the test fails. (oreofr-agent, AI-assisted)

**@⁠OreoFR** on GitHub · 2026-12-03 02:44 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#issuecomment-7365817362) Thanks @⁠merzleckeier, fixed in 2ab7c60e8. `leaving_sent` records that the leaving key counted in a driving pad, i.e. its Y was sent. Letting the key go switches to the on-foot table only then. A tap the hand-over pause swallowed keeps driving by hand and clears `leaving`; a press held through the pause sends Y and switches on release. Your tap case and the held press are both in `leaving_a_vehicle_by_hand_follows_the_remap`. `cargo test -p leonida-hle`: 258 passed. clippy: clean. With the release switching unconditionally, the test fails. (oreofr-agent, AI-assisted)
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-03 02:48 UTC · original

Confirmed the hand-over finding is fixed at 2ab7c60e merged onto d15e048a. I ran all 21 stock keyboard tests in a Windows MSVC build with overflow checks under Wine 11.22, then reran six independent probes. All passed. A G tap suppressed by the 400 ms pause kept the driving table. Holding G through the pause emitted Y and switched on release. The earlier parsing and remap probes still passed. Synthetic input only. AI-assisted with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-12-03 02:48 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#issuecomment-7365889148) Confirmed the hand-over finding is fixed at `2ab7c60e` merged onto `d15e048a`. I ran all 21 stock keyboard tests in a Windows MSVC build with overflow checks under Wine 11.22, then reran six independent probes. All passed. A G tap suppressed by the 400 ms pause kept the driving table. Holding G through the pause emitted Y and switched on release. The earlier parsing and remap probes still passed. Synthetic input only. AI-assisted with OpenAI Codex.
Author
Owner

@⁠OreoFR on GitHub · 2026-12-03 03:04 UTC · original

RUN: in-game gate of #3276 on its head merged into main (Verified by OreoFR)

  • Merge: head 2ab7c60e8f5841d32b6cefdc83e7a7f049793079 merged with git merge --no-ff into main d15e048a746896621422542b5bce28d08812d101 (merge e34a93fe5, clean, 4 files).
  • Main since then: main is now 2791b7756, which adds #3279 only: play-nvidia.ps1's VRAM reading and the launcher's card_memory. Nothing there touches gameinput. git merge-tree against it is clean, and the PR's CI (6/6) ran against it.
  • GPU: RTX 4070 Laptop 8 GB, driver 621.40, Windows 11.
  • Build: d3d12/scripts/build-nvidia.ps1 (diag profile).
  • Recipe:
    • scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGen -PrecompileUsed, BAR 0, texture budget 1024;
    • a fresh copy of the gate data, and a scripted W walk with J/L turns;
    • LEONIDA_KBM_BINDS='both:G=Square;vehicle:F=RB', with one G press at t+150 s;
    • 330 s in the world, then closed through the window.
Check Result
Device lost / removed none
Panics / ERROR lines 0 / 0
LEONIDA_KBM_BINDS info line applied, 0 skipped; 31 binds on foot, 36 in a vehicle
Last 240 s 24.55 fps, median 39.3 ms; worst frame 102 ms, 1 frame over 100 ms
Whole run 66 frames over 100 ms and 6 over 1 s, all in the first two minutes of streaming after entering the world
Close clean, pipeline library saved

Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) on this head. The remap itself is covered by the unit tests: the pad buttons the keys produce are not logged in game.

AI-assisted (oreofr-agent)

**@⁠OreoFR** on GitHub · 2026-12-03 03:04 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#issuecomment-7366166699) RUN: in-game gate of #3276 on its head merged into main (Verified by OreoFR) - **Merge:** head `2ab7c60e8f5841d32b6cefdc83e7a7f049793079` merged with `git merge --no-ff` into main `d15e048a746896621422542b5bce28d08812d101` (merge e34a93fe5, clean, 4 files). - **Main since then:** main is now `2791b7756`, which adds #3279 only: play-nvidia.ps1's VRAM reading and the launcher's `card_memory`. Nothing there touches gameinput. `git merge-tree` against it is clean, and the PR's CI (6/6) ran against it. - **GPU:** RTX 4070 Laptop 8 GB, driver 621.40, Windows 11. - **Build:** `d3d12/scripts/build-nvidia.ps1` (diag profile). - **Recipe:** - `scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGen -PrecompileUsed`, BAR 0, texture budget 1024; - a fresh copy of the gate data, and a scripted W walk with J/L turns; - `LEONIDA_KBM_BINDS='both:G=Square;vehicle:F=RB'`, with one G press at t+150 s; - 330 s in the world, then closed through the window. | Check | Result | |---|---| | Device lost / removed | none | | Panics / ERROR lines | 0 / 0 | | `LEONIDA_KBM_BINDS` info line | applied, 0 skipped; 31 binds on foot, 36 in a vehicle | | Last 240 s | 24.55 fps, median 39.3 ms; worst frame 102 ms, 1 frame over 100 ms | | Whole run | 66 frames over 100 ms and 6 over 1 s, all in the first two minutes of streaming after entering the world | | Close | clean, pipeline library saved | Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) on this head. The remap itself is covered by the unit tests: the pad buttons the keys produce are not logged in game. AI-assisted (oreofr-agent)
Author
Owner

@⁠OreoFR on GitHub · 2026-12-03 03:04 UTC · original

Merging (OreoFR's OK): head 2ab7c60e8, CI green on all six checks against main 2791b7756, in-game gate PASS above, all three of merzleckeier's review rounds addressed. Sent to the merge queue. (oreofr-agent, AI-assisted)

**@⁠OreoFR** on GitHub · 2026-12-03 03:04 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3276#issuecomment-7366167793) Merging (OreoFR's OK): head `2ab7c60e8`, CI green on all six checks against main `2791b7756`, in-game gate PASS above, all three of merzleckeier's review rounds addressed. Sent to the merge queue. (oreofr-agent, AI-assisted)
github-bot changed target branch from main to gh-pr/3276/base 2026-12-03 03:19:58 +00:00
github manually merged commit 2ab7c60e8f into gh-pr/3276/base 2026-12-03 03:20:15 +00:00
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/ubiquitarianism--leonida!3276
No description provided.