WIP: [pr-fix][input] A key bound to a button in bindings.ini no longer also drives its built-in trigger or stick #5

Closed
Jesper-A wants to merge 0 commits from Jesper-A/Darner:up-key-trigger-fix into main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit.

Base: the branch (1 commit) is on 28ef3ddb3, the main commit it was cut from. main is now dd2f061d5. Not rebased (we rebase only if you ask). A text-only trial merge (git merge-tree --write-tree trustno1/main up-key-trigger-fix) is clean, also with main's newest input commit d77869c52 (look keys in bindings.ini), which changes another function.

With MOUSE AND KEYBOARD on and a bindings.ini, a key you bind to a button could still also press the trigger or stick the built-in key table has on that key. Example: C is the right trigger in the table. With B = C, pressing C pressed B and the right trigger.

Buttons were already handled on main (the F case: the left stick click in the table, Y in the file). This extends the same rule to the table's triggers and sticks. A key bound to a button now drives only that button.

What changed, in crates/darner-hle/src/modules/gameinput.rs:

  • fallback_for_seat now reads mnk::bound_buttons() and passes it to a new function, stand_in_pad(keys, seat, bound). The rest of the old body moved there, so a test can call it without the Windows-only file reader.
  • In stand_in_pad, the closure that reads the table's controls (on) returns 0 for a key the file binds to a button. That covers the triggers, the left stick and the right stick. At the wheel (driver seat) the table's gas and brake keys go through the same closure.
  • A new unit test, a_key_bound_to_a_button_does_not_also_drive_its_trigger_or_stick, covers C and I bound to buttons, with Z and W unbound, for no seat, passenger and driver.

Not changed:

  • DARNER_BINDINGS_ONLY=1 (c3824b341; from an earlier report, not migrated) returns before the table is read. Its path is the same as before. main's d77869c52 (LookUp, LookDown, LookLeft and LookRight in bindings.ini push the right stick) is in that same path, bound_only_pad, which this PR does not touch.
  • Keys bound to a trigger or a stick in the file are not covered here. That includes the four look keys: outside DARNER_BINDINGS_ONLY=1 the native mouse path does not read them (bound_axes is used only at gameinput.rs:541 on main).
  • With no bindings.ini, nothing changes: the table works as before.

Why there is no switch: our own rule is that new behaviour goes behind a default-off switch. I read this as the fix of an existing rule instead. The comment on main already says a key the file binds "drives only what it binds there", and the buttons already follow it; triggers and sticks were missed. Still, it does change what the default path does for anyone with such a file, so this is for the maintainer to judge. A switch is easy to add if you prefer one.

This partly answers an earlier report (not migrated; the reporter's other points, such as keys bound to axes or a mouse button as X, are not touched). There is no matching issue on this host, so there is no Fixes or Refs line.

How it was tested

  • Tested revision: 8b95f46f3 (one commit on main 28ef3ddb3; not retested on dd2f061d5).
  • Commands and results, on 8b95f46f3:
    • cargo test -p darner-hle --locked --lib gameinput: 99 passed, 0 failed, 2 ignored.
    • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.
    • cargo xtask policy: ok.
    • cargo test --workspace --locked: not run.
    • There is no CI upstream; none of this is a CI result.
  • Gameplay: RTX 2070 SUPER 8 GB (Turing), driver 621.40, ReBAR off, Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 26320, Series S, DLSS Performance. The same change was played on our own build (commit d618e2704, before the merge with main's DARNER_BINDINGS_ONLY / stand_in_pad hunk) with a bindings.ini that has B = C, Ctrl, R, Backspace. The player saw it fixed: C no longer also pulled the right trigger. This PR's head (8b95f46f3) was not run in game.
  • Before and after: not measured; this is not a performance change.
  • Shader wave sizes: not relevant.
  • Coverage gaps: cargo test --workspace --locked not run; head not run in game; keys bound to triggers or sticks not tested; non-Windows build (the file reader is Windows-only) not built.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Spec dependence

  • Likely general (helps any card): all of it. It is key handling, with no GPU, shader or memory path involved.
  • May depend on our specs: none.
  • Untested elsewhere: other hardware and keyboard layouts, Series X.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found for the same problem. On 2026-12-03 this host had 3 issues and 1 pull request in total; none is about key bindings. The one open pull request (#3, ray tracing mode in F1) changes host/menu.rs, host/panel.rs and hwrt.rs, not gameinput.rs. Our own re-filed wheel PR (branch pr4-wheel-hold) also changes gameinput.rs, in another place (the radial wheel); it does not touch fallback_for_seat.

This change was made with AI assistance (Claude Code).

## Contributor role (optional) - Fluxer ID: ## What it changes Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit. **Base:** the branch (1 commit) is on `28ef3ddb3`, the `main` commit it was cut from. `main` is now `dd2f061d5`. Not rebased (we rebase only if you ask). A text-only trial merge (`git merge-tree --write-tree trustno1/main up-key-trigger-fix`) is clean, also with `main`'s newest input commit d77869c52 (look keys in `bindings.ini`), which changes another function. With MOUSE AND KEYBOARD on and a `bindings.ini`, a key you bind to a button could still also press the trigger or stick the built-in key table has on that key. Example: C is the right trigger in the table. With `B = C`, pressing C pressed B and the right trigger. Buttons were already handled on `main` (the F case: the left stick click in the table, Y in the file). This extends the same rule to the table's triggers and sticks. A key bound to a button now drives only that button. What changed, in `crates/darner-hle/src/modules/gameinput.rs`: - `fallback_for_seat` now reads `mnk::bound_buttons()` and passes it to a new function, `stand_in_pad(keys, seat, bound)`. The rest of the old body moved there, so a test can call it without the Windows-only file reader. - In `stand_in_pad`, the closure that reads the table's controls (`on`) returns 0 for a key the file binds to a button. That covers the triggers, the left stick and the right stick. At the wheel (driver seat) the table's gas and brake keys go through the same closure. - A new unit test, `a_key_bound_to_a_button_does_not_also_drive_its_trigger_or_stick`, covers C and I bound to buttons, with Z and W unbound, for no seat, passenger and driver. Not changed: - `DARNER_BINDINGS_ONLY=1` (c3824b341; from an earlier report, not migrated) returns before the table is read. Its path is the same as before. `main`'s d77869c52 (`LookUp`, `LookDown`, `LookLeft` and `LookRight` in `bindings.ini` push the right stick) is in that same path, `bound_only_pad`, which this PR does not touch. - Keys bound to a trigger or a stick in the file are not covered here. That includes the four look keys: outside `DARNER_BINDINGS_ONLY=1` the native mouse path does not read them (`bound_axes` is used only at `gameinput.rs:541` on `main`). - With no `bindings.ini`, nothing changes: the table works as before. Why there is no switch: our own rule is that new behaviour goes behind a default-off switch. I read this as the fix of an existing rule instead. The comment on `main` already says a key the file binds "drives only what it binds there", and the buttons already follow it; triggers and sticks were missed. Still, it does change what the default path does for anyone with such a file, so this is for the maintainer to judge. A switch is easy to add if you prefer one. This partly answers an earlier report (not migrated; the reporter's other points, such as keys bound to axes or a mouse button as X, are not touched). There is no matching issue on this host, so there is no `Fixes` or `Refs` line. ## How it was tested - Tested revision: 8b95f46f3 (one commit on `main` 28ef3ddb3; not retested on `dd2f061d5`). - Commands and results, on 8b95f46f3: - `cargo test -p darner-hle --locked --lib gameinput`: 99 passed, 0 failed, 2 ignored. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: clean. - `cargo xtask policy`: ok. - `cargo test --workspace --locked`: not run. - There is no CI upstream; none of this is a CI result. - Gameplay: RTX 2070 SUPER 8 GB (Turing), driver 621.40, ReBAR off, Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 26320, Series S, DLSS Performance. The same change was played on our own build (commit d618e2704, before the merge with `main`'s `DARNER_BINDINGS_ONLY` / `stand_in_pad` hunk) with a `bindings.ini` that has `B = C, Ctrl, R, Backspace`. The player saw it fixed: C no longer also pulled the right trigger. **This PR's head (8b95f46f3) was not run in game.** - Before and after: not measured; this is not a performance change. - Shader wave sizes: not relevant. - Coverage gaps: `cargo test --workspace --locked` not run; head not run in game; keys bound to triggers or sticks not tested; non-Windows build (the file reader is Windows-only) not built. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Spec dependence - Likely general (helps any card): all of it. It is key handling, with no GPU, shader or memory path involved. - May depend on our specs: none. - Untested elsewhere: other hardware and keyboard layouts, Series X. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found for the same problem. On 2026-12-03 this host had 3 issues and 1 pull request in total; none is about key bindings. The one open pull request (#3, ray tracing mode in F1) changes `host/menu.rs`, `host/panel.rs` and `hwrt.rs`, not `gameinput.rs`. Our own re-filed wheel PR (branch `pr4-wheel-hold`) also changes `gameinput.rs`, in another place (the radial wheel); it does not touch `fallback_for_seat`. This change was made with AI assistance (Claude Code).
With MOUSE AND KEYBOARD and bindings.ini, a key bound to a button still
pressed the trigger or stick the built-in table has on it, e.g. C (right
trigger in the table) bound to B pressed B and the right trigger. Buttons
were already handled; DARNER_BINDINGS_ONLY=1 is unchanged. Tested in game by
the player with C bound to B: fixed (on our play build).

This change was made with AI assistance (Claude Code).
Author
Contributor

Merged into main as 30887eb03 ("Merge PR #5"): 30887eb03. Closing.

Merged into main as 30887eb03 ("Merge PR #5"): https://git.gtahub.st/TrustNo1/Darner/commit/30887eb03. Closing.
Jesper-A closed this pull request 2026-12-03 20:29:21 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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
TrustNo1/Darner!5
No description provided.