WIP: [pr-feature][input] Mouse and keyboard: hold keys have the mouse place a stick or trigger that stays #429

Draft
EmberReD wants to merge 2 commits from EmberReD/Darner:feat/held-sticks-from-mouse into main
First-time contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: read from the code and seen in the game. With mouse and keyboard, the stand-in pad's sticks and triggers come from keys, which push a stick fully or not at all, and the mouse only looks. The mini games that want a stick held at a spot (hotwiring a vehicle: both sticks held at points of a circle) or a trigger held part way can't be played.

What this does:

  • Four new bindings in bindings.ini: HoldLeftStick, HoldRightStick, HoldLT, HoldRT (gameinput::Hold). While one is down, the mouse moves that stick anywhere in its circle, or pulls that trigger part way (moving the mouse up pulls it), and the control stays where it was left until the key is let go. With two down, the mouse moves the one pressed last and the other keeps its place. 400 mouse counts move a control from rest to the rim.
  • The camera stays still while a hold key is down: with the native mouse (DARNER_MNK=1) the counts go to the held control and not to the camera hook (HOLDING, read in take_mouse_delta_at). With the stand-in mouse, the title's mouse does not move and does not jump afterwards.
  • Bound by default: Z, C, 1 and 3 in the shipped bindings.ini, laid out by place like its other letters (W, C, 1, 3 on AZERTY), so the left hand holds them in a controller's order. An existing bindings.ini without these lines gets the missing ones added at launch (play::new_holds). A line is left out if the file already sets that hold or uses its key for something else. Nothing else in the file is changed.
  • F1 KEY BINDINGS lists the four lines.
  • A hold key is a bound key: like the others since #364, it doesn't reach the title's own keyboard handling, and a built-in table key it uses is let go (on US, the table's Z and C, its digital LT and RT; the mouse buttons still drive the triggers).

How it was tested

  • Tested revision: 7c418aa (one commit on #364's e56ae682c6). The gates ran on d3433b0, the same files before the commit message was reworded. In the game: a build of the same files.
  • Commands and results: see the gates below. New test a_hold_key_has_the_mouse_place_a_control_that_stays (both mouse paths); the_default_bindings_are_never_written_over_a_file_that_is_there now also covers adding the hold lines.
  • Changes a default: yes, for mouse and keyboard players: Z, C, 1 and 3 (by place) now hold a control and no longer reach the title or drive the table's Z and C.
  • A/B result: not a speed change. A (v2026.12.03.02 with #364): reported by the player, a mini game that wants both sticks held at spots of a circle can't be done with keys. B (this): the hotwiring mini game worked with the hold keys and the mouse (player's report and the video below, cut, no audio).
  • Video: hold-sticks-demo.mp4
  • Gates run on d3433b0 (Windows 10 22H2): gate 1 and gate 2 clean. Gate 3 with --no-fail-fast: darner-hle 496 passed (15 ignored), darner 148 passed, darner-game and the other crates pass. Two crates fail here: darner-shader, 65 card and WARP cases with "no SM 6.6 device available" (it depends on no changed crate, the same as on #364), and darner-gpu, whose test process exits with code 3. This change touches darner-gpu only for the four F1 rows: cargo test -p darner-gpu --lib -- host::menu:: passes 48 (2 ignored) with every_view_fits_its_box_at_every_scale and the_link_is_always_right_under_the_note skipped, and those two exit with code 3 on main f3840d7 too.
  • Gameplay: RTX 3070 Ti, Series S profile, 1080p to 1440p, DLSS quality, DLSS frame generation x2, no ray tracing. AZERTY (French) keyboard, native mouse on, hold keys bound in F1 to W, C, 1 and 3 (the defaults' places on AZERTY). About 12 fps with the GPU fully busy in that scene, so the controls feel slow there.
  • Shader wave sizes tested: not relevant (input only).
  • Hardware dependence: none expected.
  • Coverage gaps: the triggers and the stand-in mouse path (native mouse off) were checked by the tests only. The defaults on a US layout, and adding the lines to an older bindings.ini, were checked by the tests only (the test player's file already had them).

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main. It is one change, but based on #364's branch, which it needs (draft until #364 is merged).
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on #364 (a bound key kept from the title, the file's keys beside the table, the layout's default file)

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #364 (prerequisite); #405 (Mouse4, Mouse5 and the wheel in bindings.ini, also changes gameinput.rs and mnk.rs); #302, #276, #216, #185, #399 (also change gameinput.rs, other parts).
  • Replaces or overlaps: none found

🤖 Generated with Claude Code

## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: read from the code and seen in the game. With mouse and keyboard, the stand-in pad's sticks and triggers come from keys, which push a stick fully or not at all, and the mouse only looks. The mini games that want a stick held at a spot (hotwiring a vehicle: both sticks held at points of a circle) or a trigger held part way can't be played. What this does: - **Four new bindings** in `bindings.ini`: `HoldLeftStick`, `HoldRightStick`, `HoldLT`, `HoldRT` (`gameinput::Hold`). While one is down, the mouse moves that stick anywhere in its circle, or pulls that trigger part way (moving the mouse up pulls it), and the control stays where it was left until the key is let go. With two down, the mouse moves the one pressed last and the other keeps its place. 400 mouse counts move a control from rest to the rim. - **The camera stays still** while a hold key is down: with the native mouse (`DARNER_MNK=1`) the counts go to the held control and not to the camera hook (`HOLDING`, read in `take_mouse_delta_at`). With the stand-in mouse, the title's mouse does not move and does not jump afterwards. - **Bound by default**: `Z`, `C`, `1` and `3` in the shipped `bindings.ini`, laid out by place like its other letters (W, C, 1, 3 on AZERTY), so the left hand holds them in a controller's order. An existing `bindings.ini` without these lines gets the missing ones added at launch (`play::new_holds`). A line is left out if the file already sets that hold or uses its key for something else. Nothing else in the file is changed. - **F1 KEY BINDINGS** lists the four lines. - A hold key is a bound key: like the others since #364, it doesn't reach the title's own keyboard handling, and a built-in table key it uses is let go (on US, the table's Z and C, its digital LT and RT; the mouse buttons still drive the triggers). ## How it was tested - Tested revision: 7c418aa (one commit on #364's e56ae682c6). The gates ran on d3433b0, the same files before the commit message was reworded. In the game: a build of the same files. - Commands and results: see the gates below. New test `a_hold_key_has_the_mouse_place_a_control_that_stays` (both mouse paths); `the_default_bindings_are_never_written_over_a_file_that_is_there` now also covers adding the hold lines. - Changes a default: yes, for mouse and keyboard players: Z, C, 1 and 3 (by place) now hold a control and no longer reach the title or drive the table's Z and C. - A/B result: not a speed change. A (v2026.12.03.02 with #364): reported by the player, a mini game that wants both sticks held at spots of a circle can't be done with keys. B (this): the hotwiring mini game worked with the hold keys and the mouse (player's report and the video below, cut, no audio). - Video: [hold-sticks-demo.mp4](https://git.gtahub.st/attachments/0af16a79-1387-4194-8c95-81805d730ece) - Gates run on d3433b0 (Windows 10 22H2): gate 1 and gate 2 clean. Gate 3 with `--no-fail-fast`: darner-hle 496 passed (15 ignored), darner 148 passed, darner-game and the other crates pass. Two crates fail here: darner-shader, 65 card and WARP cases with "no SM 6.6 device available" (it depends on no changed crate, the same as on #364), and darner-gpu, whose test process exits with code 3. This change touches darner-gpu only for the four F1 rows: `cargo test -p darner-gpu --lib -- host::menu::` passes 48 (2 ignored) with `every_view_fits_its_box_at_every_scale` and `the_link_is_always_right_under_the_note` skipped, and those two exit with code 3 on main f3840d7 too. - Gameplay: RTX 3070 Ti, Series S profile, 1080p to 1440p, DLSS quality, DLSS frame generation x2, no ray tracing. AZERTY (French) keyboard, native mouse on, hold keys bound in F1 to W, C, 1 and 3 (the defaults' places on AZERTY). About 12 fps with the GPU fully busy in that scene, so the controls feel slow there. - Shader wave sizes tested: not relevant (input only). - Hardware dependence: none expected. - Coverage gaps: the triggers and the stand-in mouse path (native mouse off) were checked by the tests only. The defaults on a US layout, and adding the lines to an older `bindings.ini`, were checked by the tests only (the test player's file already had them). ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [ ] This PR contains one change based on `main`. It is one change, but based on #364's branch, which it needs (draft until #364 is merged). - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on #364 (a bound key kept from the title, the file's keys beside the table, the layout's default file) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #364 (prerequisite); #405 (Mouse4, Mouse5 and the wheel in `bindings.ini`, also changes `gameinput.rs` and `mnk.rs`); #302, #276, #216, #185, #399 (also change `gameinput.rs`, other parts). - Replaces or overlaps: none found 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With mouse and keyboard on, a key bound in bindings.ini also reached the title's own
keyboard handling: on AZERTY, Q bound to move left also took cover. Bound keys are now
kept from the title, letters are read as the layout prints them, bindings.ini's move and
trigger keys count beside the built-in table (a table key the file uses elsewhere is let
go), and the default file is written for the player's layout (Z/Q/S/D on AZERTY).
Mini games such as cloning a car key want both sticks held at points of a circle, or a
trigger held part way; keys only push a stick fully or not at all. HoldLeftStick,
HoldRightStick, HoldLT and HoldRT in bindings.ini (by default Z, C, 1 and 3 by place):
while one is down, the mouse moves that control and it stays where it was left; the
camera does not move meanwhile. An older bindings.ini gets the default lines it lacks,
leaving out a key it already uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
EmberReD force-pushed feat/held-sticks-from-mouse from d3433b0472 to 7c418aa32b 2026-12-04 21:30:31 +00:00 Compare
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/held-sticks-from-mouse:EmberReD-feat/held-sticks-from-mouse'
git switch 'EmberReD-feat/held-sticks-from-mouse'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'EmberReD-feat/held-sticks-from-mouse'
git switch 'EmberReD-feat/held-sticks-from-mouse'
git rebase 'main'
git switch 'main'
git merge --ff-only 'EmberReD-feat/held-sticks-from-mouse'
git switch 'EmberReD-feat/held-sticks-from-mouse'
git rebase 'main'
git switch 'main'
git merge --no-ff 'EmberReD-feat/held-sticks-from-mouse'
git switch 'main'
git merge --squash 'EmberReD-feat/held-sticks-from-mouse'
git switch 'main'
git merge --ff-only 'EmberReD-feat/held-sticks-from-mouse'
git switch 'main'
git merge 'EmberReD-feat/held-sticks-from-mouse'
git push origin 'main'
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!429
No description provided.