fix(host): the Deck's built-in controls do not also fire the mouse's bindings #1721

Merged
HumanBean merged 3 commits from omgitsgela/Longshot:deck-builtin-mouse into main 2026-11-21 01:33:09 +00:00
Member

Type: fix · Risk: low · Tested on: Linux, game-free fixtures only (the game run is pending) · Needs: Steam Deck, desktop mode

TL;DR

On a Steam Deck in desktop mode, Steam translates the triggers into mouse clicks for the game's window. The default controls also put Y on the mouse's left button, so pressing R2 fired two actions at once. This PR stops the mouse's gameplay bindings from counting while the Deck's built-in controls are giving input. A new test drives the real input path and passes here; I have not run the build in the game yet.

Breakdown

  • Who it helps: anyone playing on a Steam Deck, especially in desktop mode outside Steam.
  • What was wrong: the Deck's controls report R2 as a trigger and Steam reports it again as a left click, which is bound to Y.
  • What changes: while the Deck's built-in controls are live, the mouse's gameplay bindings do not count.
  • What does not change: the mouse's pointer, its clicks in the game's own menus, the side buttons, and the controls of every other pad.
  • How it was checked: a new case in tests/test_input_background.py drives the real read_input through the pad and mouse; tests/test_steam_pads.py covers the pad test itself; the fixtures that stub the changed signatures are updated.
  • What is still open: the game run on a Deck. The installed build predates this change.
  • Risk: low. A mouse's gameplay buttons do not count on a Deck while its built-in controls are connected.

Why

In desktop mode Steam applies its desktop layout to any focused window that is not a Steam app, and that layout emits mouse clicks for the triggers. Longshot binds the mouse's left button to Y and the right one to ZL by default, and a mouse button counts while the mouse is captured. So on a Deck the trigger presses twice: once as the trigger, once as the face button. Reported while testing the deck as "what is supposed to be R2 is also bound to X button", and it came and went with the capture, which is what made it look erratic.

See #1563

How to reproduce

Seen on: SteamOS 3 (Steam Deck LCD, VanGogh), desktop mode, game launched outside Steam
Settings and switches: defaults, mouse captured (Mouse camera Native or As the stick)
Steps: in play, press R2
Expected: one action
Actual: on main, the trigger's action and the left button's action (Y, attack) both fire

What changed

The Deck's built-in controls are recognised by identity, and the mouse's gameplay bindings are armed only when they are not contributing.

  • host/pad_sdl.c: each pad's USB product id is recorded beside its vendor and Steam Input handle; pads_poll samples steam_pads_deck_builtin() once a poll after the motion-only skip, and hos_sdl_pads() hands the answer out through the same lock as that poll's buttons, so the two always describe one poll.
  • host/steam_pads.h: steam_pads_deck_builtin(vendor, product, steam_handle), Valve's vendor with the Deck's product id and no Steam Input handle (a stand-in pad's).
  • host/nn_hid.c: pads_read carries the answer out; read_input arms the mouse's buttons with mouse_buttons_arm(captured && !deck_builtin_input, menu_mouse). A button already down when the rule applies is let go before it counts again, as the capture's own click already was.
  • host/hos_sdl.c, host/hos_sdl.h, host/prompts.c: hos_sdl_pad_product() and the new parameter at the existing call sites.

Measurements

Verdict: passes. The mouse's gameplay bindings no longer fire while the Deck's built-in controls are giving input, and the game-free checks that prove it do not build on main (they name symbols it does not have) and pass here. Nothing to measure for speed: this routes existing input and draws nothing new.

Hardware: Linux x86-64 for the fixtures; the game run is still to come on a Steam Deck LCD.
Scene: none; the fixture supplies a fake pad and a fake mouse state to the real read_input.
Method: tests/*.py, each compiling the production functions out of host/ into a small program; one deterministic run each.
How to reproduce: python3 tests/test_input_background.py --case deck-mouse in the checkout.

Check Before: main @ 1013b434 After: this PR @ e185baac
tests/test_input_background.py --case deck-mouse does not build: read_input has no deck_builtin_input to pass PASS
tests/test_steam_pads.py does not build, as this PR writes it: no steam_pads_deck_builtin on main ok
tests/test_pads_after_menu.py PASS PASS
tests/test_motion_background.py PASS PASS
$ python3 tests/test_input_background.py --case deck-mouse      # this PR
PASS: the Deck's built-in controls give their actions once, not twice through the mouse interface they also expose

$ python3 tests/test_steam_pads.py                              # this PR
ok: Steam's ignore list without Valve's pads, their motion-only rule, and the Deck's built-in controls

Flags and settings

None: the rule is automatic, with no switch, menu row or ini key. That was the ask: on a Deck the built-in controls are always there.

Testing

Tested: game-free, on Linux. tests/test_input_background.py (all cases, including the new deck-mouse), tests/test_steam_pads.py, tests/test_pads_after_menu.py, tests/test_motion_background.py, tests/test_gyro_rearm.py, tests/test_bound_keys.py, tests/test_menu_text_field.py, tests/test_menu_keys.py, tests/test_readme_menu_rows.py, tests/test_stick_buttons.py. tests/run_all.py on this branch: 676 passed, 37 failed, 125 skipped. main (1013b434) in the same environment: 672 passed, 41 failed, 125 skipped. Every one of this branch's 36 distinct failing files also fails on main, so none of them comes from this PR: test_bug_report_defaults, test_capture_read_once, test_crt_options, test_damage_debug_menu, test_dev_packs, test_discover, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_guest_imported, test_high_fps_fixes, test_host_guest_writes, test_hud_layout_row, test_invalidate_quick, test_libc_hooks, test_lift_lookups, test_link_skip, test_linux_pressure, test_linux_update, test_log_open_failure, test_missing_nup, test_mods_size_table, test_pending_guest_import, test_pipeline_play_cache, test_prepare_cache_save, test_present_thread, test_profiling_mode, test_psychov35_fsr3_fg, test_readback_timeout_source, test_slow_frames, test_song_note_cue, test_switch_table, test_upscaler_rows, test_vcore_escape, test_walk_key, test_walk.

Not tested: the game itself. I have not run a build of this branch on a Deck; the behaviour above is proven through the real read_input with a fake pad and mouse state, not by pressing R2.

Must be tested:

  • Steam Deck LCD, SteamOS 3, desktop mode, game launched outside Steam: load a save, press R2 in play, expecting one action (the trigger's) and no face button. Then press L2, expecting one action. Then open the pause menu and click with the pad, expecting the menu's own clicks to still work (by hand: Angela, and the Test Farm with steamdeck at https://beanstalk.magicbean.dev/how).

Risks

What could break: on a Deck, a mouse's gameplay bindings stop counting while the built-in controls give input, so an external mouse's left click no longer attacks. The pointer, the game's menus and the side buttons are untouched. Other pads and other platforms are untouched.

Turning it off: revert the commit. There is no switch.

Compatibility: nothing changes for a player after updating: no MKWVK_API_VERSION change, and the shader stamp does not hold host/ (nx2/translator_files.py), so the caches are kept.

Issues

See #1563

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
**Type:** fix · **Risk:** low · **Tested on:** Linux, game-free fixtures only (the game run is pending) · **Needs:** Steam Deck, desktop mode ## TL;DR On a Steam Deck in desktop mode, Steam translates the triggers into mouse clicks for the game's window. The default controls also put Y on the mouse's left button, so pressing R2 fired two actions at once. This PR stops the mouse's gameplay bindings from counting while the Deck's built-in controls are giving input. A new test drives the real input path and passes here; I have not run the build in the game yet. ## Breakdown - **Who it helps:** anyone playing on a Steam Deck, especially in desktop mode outside Steam. - **What was wrong:** the Deck's controls report R2 as a trigger and Steam reports it again as a left click, which is bound to Y. - **What changes:** while the Deck's built-in controls are live, the mouse's gameplay bindings do not count. - **What does not change:** the mouse's pointer, its clicks in the game's own menus, the side buttons, and the controls of every other pad. - **How it was checked:** a new case in `tests/test_input_background.py` drives the real `read_input` through the pad and mouse; `tests/test_steam_pads.py` covers the pad test itself; the fixtures that stub the changed signatures are updated. - **What is still open:** the game run on a Deck. The installed build predates this change. - **Risk:** low. A mouse's gameplay buttons do not count on a Deck while its built-in controls are connected. ## Why In desktop mode Steam applies its desktop layout to any focused window that is not a Steam app, and that layout emits mouse clicks for the triggers. Longshot binds the mouse's left button to Y and the right one to ZL by default, and a mouse button counts while the mouse is captured. So on a Deck the trigger presses twice: once as the trigger, once as the face button. Reported while testing the deck as "what is supposed to be R2 is also bound to X button", and it came and went with the capture, which is what made it look erratic. See https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1563 ## How to reproduce **Seen on:** SteamOS 3 (Steam Deck LCD, VanGogh), desktop mode, game launched outside Steam **Settings and switches:** defaults, mouse captured (Mouse camera Native or As the stick) **Steps:** in play, press R2 **Expected:** one action **Actual:** on main, the trigger's action and the left button's action (Y, attack) both fire ## What changed The Deck's built-in controls are recognised by identity, and the mouse's gameplay bindings are armed only when they are not contributing. - `host/pad_sdl.c`: each pad's USB product id is recorded beside its vendor and Steam Input handle; `pads_poll` samples `steam_pads_deck_builtin()` once a poll after the motion-only skip, and `hos_sdl_pads()` hands the answer out through the same lock as that poll's buttons, so the two always describe one poll. - `host/steam_pads.h`: `steam_pads_deck_builtin(vendor, product, steam_handle)`, Valve's vendor with the Deck's product id and no Steam Input handle (a stand-in pad's). - `host/nn_hid.c`: `pads_read` carries the answer out; `read_input` arms the mouse's buttons with `mouse_buttons_arm(captured && !deck_builtin_input, menu_mouse)`. A button already down when the rule applies is let go before it counts again, as the capture's own click already was. - `host/hos_sdl.c`, `host/hos_sdl.h`, `host/prompts.c`: `hos_sdl_pad_product()` and the new parameter at the existing call sites. ## Measurements **Verdict:** passes. The mouse's gameplay bindings no longer fire while the Deck's built-in controls are giving input, and the game-free checks that prove it do not build on `main` (they name symbols it does not have) and pass here. Nothing to measure for speed: this routes existing input and draws nothing new. Hardware: Linux x86-64 for the fixtures; the game run is still to come on a Steam Deck LCD. Scene: none; the fixture supplies a fake pad and a fake mouse state to the real `read_input`. Method: `tests/*.py`, each compiling the production functions out of `host/` into a small program; one deterministic run each. How to reproduce: `python3 tests/test_input_background.py --case deck-mouse` in the checkout. | Check | Before: main @ 1013b434 | After: this PR @ e185baac | |---|---|---| | `tests/test_input_background.py --case deck-mouse` | does not build: `read_input` has no `deck_builtin_input` to pass | PASS | | `tests/test_steam_pads.py` | does not build, as this PR writes it: no `steam_pads_deck_builtin` on main | ok | | `tests/test_pads_after_menu.py` | PASS | PASS | | `tests/test_motion_background.py` | PASS | PASS | ``` $ python3 tests/test_input_background.py --case deck-mouse # this PR PASS: the Deck's built-in controls give their actions once, not twice through the mouse interface they also expose $ python3 tests/test_steam_pads.py # this PR ok: Steam's ignore list without Valve's pads, their motion-only rule, and the Deck's built-in controls ``` ### Flags and settings None: the rule is automatic, with no switch, menu row or ini key. That was the ask: on a Deck the built-in controls are always there. ## Testing **Tested:** game-free, on Linux. `tests/test_input_background.py` (all cases, including the new `deck-mouse`), `tests/test_steam_pads.py`, `tests/test_pads_after_menu.py`, `tests/test_motion_background.py`, `tests/test_gyro_rearm.py`, `tests/test_bound_keys.py`, `tests/test_menu_text_field.py`, `tests/test_menu_keys.py`, `tests/test_readme_menu_rows.py`, `tests/test_stick_buttons.py`. `tests/run_all.py` on this branch: 676 passed, 37 failed, 125 skipped. `main` (1013b434) in the same environment: 672 passed, 41 failed, 125 skipped. Every one of this branch's 36 distinct failing files also fails on `main`, so none of them comes from this PR: `test_bug_report_defaults`, `test_capture_read_once`, `test_crt_options`, `test_damage_debug_menu`, `test_dev_packs`, `test_discover`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_failed_compile_keeps_objects`, `test_guest_imported`, `test_high_fps_fixes`, `test_host_guest_writes`, `test_hud_layout_row`, `test_invalidate_quick`, `test_libc_hooks`, `test_lift_lookups`, `test_link_skip`, `test_linux_pressure`, `test_linux_update`, `test_log_open_failure`, `test_missing_nup`, `test_mods_size_table`, `test_pending_guest_import`, `test_pipeline_play_cache`, `test_prepare_cache_save`, `test_present_thread`, `test_profiling_mode`, `test_psychov35_fsr3_fg`, `test_readback_timeout_source`, `test_slow_frames`, `test_song_note_cue`, `test_switch_table`, `test_upscaler_rows`, `test_vcore_escape`, `test_walk_key`, `test_walk`. **Not tested:** the game itself. I have not run a build of this branch on a Deck; the behaviour above is proven through the real `read_input` with a fake pad and mouse state, not by pressing R2. **Must be tested:** - Steam Deck LCD, SteamOS 3, desktop mode, game launched outside Steam: load a save, press R2 in play, expecting one action (the trigger's) and no face button. Then press L2, expecting one action. Then open the pause menu and click with the pad, expecting the menu's own clicks to still work (by hand: Angela, and the Test Farm with `steamdeck` at https://beanstalk.magicbean.dev/how). ## Risks **What could break:** on a Deck, a mouse's gameplay bindings stop counting while the built-in controls give input, so an external mouse's left click no longer attacks. The pointer, the game's menus and the side buttons are untouched. Other pads and other platforms are untouched. **Turning it off:** revert the commit. There is no switch. **Compatibility:** nothing changes for a player after updating: no `MKWVK_API_VERSION` change, and the shader stamp does not hold `host/` (nx2/translator_files.py), so the caches are kept. ## Issues See https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1563 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [ ] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [ ] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
fix(host): the Deck's built-in controls do not also fire the mouse's bindings
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
0b72a8911e
On the Steam Deck's desktop, Steam applies its Desktop layout to the
game's window and translates the triggers into mouse clicks: R2 arrives
as a left click and L2 as a right one, beside the pad's own report of
those buttons. The default bindings put Y on the left button and ZL on
the right, so a trigger press fired twice. Played as a double trigger,
which is what was reported: "what is supposed to be R2 is also bound to
X". The injected click only counted while the mouse was captured, which
is why it came and went.

pad_sdl.c now records each pad's USB product id beside its vendor and
Steam Input handle, and steam_pads.h gains steam_pads_deck_builtin():
Valve's vendor, the Deck's product id, and no Steam Input handle (a
stand-in pad's). It is sampled once a poll with the buttons, after the
motion-only skip, and pads_read hands it out through the same lock as
that poll's buttons, so the two always describe one poll. read_input
arms the mouse's buttons for gameplay only while those controls are not
contributing: mouse_buttons_arm(captured && !deck_builtin_input, ...).

Nothing else changes for the mouse. Its pointer, its clicks in one of
the game's own menus and the side buttons there are armed as before, so
as a menu opens or closes the buttons stay what they were. A button
already down when the rule starts applying is let go before it can
count again, as the capture's own click always was.

The rule is automatic rather than an option: on a Deck the built-in
controls are always there. The cost is that a mouse's gameplay bindings
do not count while they are, so an external mouse's left click no longer
attacks on the Deck. That was the trade asked for: the controls' own
buttons carry those actions, and the mouse is not what the Deck is
played with.

tests/test_input_background.py's deck-mouse case drives the real
read_input: the click is Y with an ordinary pad, and is not while the
built-in controls give input, including one held through the change and
in and out of a game menu. tests/test_steam_pads.py covers the
predicate's cases, and the fixtures that stubbed the old pads_read and
hos_sdl_pads signatures are updated with it.

Assisted-by: GPT-6.1 Sol via Hermes Agent
omgitsgela force-pushed deck-builtin-mouse from 0b72a8911e
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to e185baac8c
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-19 07:23:41 +00:00
Compare
Author
Member

Full suite on this branch (Linux VM, 12 at once): 676 passed, 37 failed, 125 skipped. Pristine main 1013b434 with the same command in the same environment: 672 passed, 41 failed, 125 skipped. Every one of this branch's 36 distinct failing files also fails on main; four that fail on main (test_bug_report, test_crash_groups, test_hardware_report, test_perf_report) passed here. So nothing in the list comes from this PR, and the box is ticked with the list named in the description.

Full suite on this branch (Linux VM, 12 at once): 676 passed, 37 failed, 125 skipped. Pristine main 1013b434 with the same command in the same environment: 672 passed, 41 failed, 125 skipped. Every one of this branch's 36 distinct failing files also fails on main; four that fail on main (test_bug_report, test_crash_groups, test_hardware_report, test_perf_report) passed here. So nothing in the list comes from this PR, and the box is ticked with the list named in the description.
HumanBean approved these changes 2026-11-20 08:19:29 +00:00
Dismissed
HumanBean added this to the WIP project 2026-11-20 08:19:35 +00:00
omgitsgela force-pushed deck-builtin-mouse from e185baac8c
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to f7eeebab5b
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 7s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-20 11:29:10 +00:00
Compare
omgitsgela dismissed HumanBean's review 2026-11-20 11:29:10 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Author
Member

Rebased onto current main: the only conflict was additive state in pads_read — main's status_used/status_pad (the Steam Deck guide hold) and this fix's deck_builtin both stay. Head is now f7eeebab, and git merge-tree onto main is clean, so this is mergeable.

The rule itself is unchanged: host/steam_pads.h asks whether Valve's built-in controls are giving input, pads_read hands that out through the same lock as the buttons it was read with, and read_input arms the mouse's gameplay buttons with mouse_buttons_arm(captured && !deck_builtin_input, ...). A mouse click already down when the rule starts applying is let go before it can count again. Nothing else about the mouse changes: pointer, menu clicks and the side buttons are armed as before.

Measured on the Deck: with the fix, L = L only; with it absent, one L press reports L 11 times in a quarter second and D-pad up becomes D-pad left, exactly what the last scheduler-only build reproduced when its branch turned out to be current main without this fix.

Assisted-by: Hermes Agent (qwen38)

Rebased onto current main: the only conflict was additive state in pads_read — main's `status_used`/`status_pad` (the Steam Deck guide hold) and this fix's `deck_builtin` both stay. Head is now f7eeebab, and `git merge-tree` onto main is clean, so this is mergeable. The rule itself is unchanged: host/steam_pads.h asks whether Valve's built-in controls are giving input, pads_read hands that out through the same lock as the buttons it was read with, and read_input arms the mouse's gameplay buttons with mouse_buttons_arm(captured && !deck_builtin_input, ...). A mouse click already down when the rule starts applying is let go before it can count again. Nothing else about the mouse changes: pointer, menu clicks and the side buttons are armed as before. Measured on the Deck: with the fix, L = L only; with it absent, one L press reports L 11 times in a quarter second and D-pad up becomes D-pad left, exactly what the last scheduler-only build reproduced when its branch turned out to be current main without this fix. Assisted-by: Hermes Agent (qwen38)
fix(host): the Deck's built-in controls' right stick does not also drive the mouse's camera
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
0de52e1eb4
Steam's Desktop layout drives the mouse with the right stick as well as
the buttons, so with the built-in controls giving gameplay input the
camera took the pad's stick and the mouse's motion: pan up/down moved
twice, and with Mouse camera Off nothing captured the pointer, so a
mouse flew across the window.

While those controls give payoff input the mouse now steers nothing:
Native's camera hook is not asked for and the stick path's motion is
dropped, while the mouse is still taken in (captured, held at the
center) so its pointer never shows on the window. An ordinary mouse is
unchanged, and the built-in controls go back to being one pad as soon
as they stop giving input.

tests/test_input_background.py: a deck-motion case, which fails without
the gate and passes with it.
Merge current main into deck-builtin-mouse
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Failing after 4s
CI / Website build and checks (pull_request) Failing after 27s
33a05484b4
Port the built-in-controls rule onto main's input changes: the HUD
binding generation, Sprint's pad state, and the pad product id stay,
and pads_read still hands the Deck's built-in state back with the same
poll as the buttons.

Assisted-by: Hermes Agent (deepseek-flash)
Author
Member

Merged current main (fc4a6769) into the branch; head is 33a05484. The conflicts were main's input changes: the HUD binding generation and its cache, Sprint's pad state, and the pad product id now used by the vibration code. The built-in-controls rule is unchanged: pads_read still hands back whether the Deck's built-in controls gave gameplay input in the same poll as the buttons, and the mouse's gameplay bindings are armed only when they did not.

Checks: tests/run_all.py input 5 passed; tests/test_steam_pads.py, tests/test_walk_key.py pass. tests/run_all.py --changed origin/main is 47 passed / 4 failed / 4 skipped, and all four also fail on clean main here: test_host_guest_writes, test_mods_size_table, test_pads_after_menu (gcc's warning), and test_sprint.

Still WIP for the one remaining item: a real Deck game run. Press R2 in desktop mode and check it fires once, not the trigger plus the mouse's Y. testing wanted and the Deck build are the next step.

Merged current `main` (`fc4a6769`) into the branch; head is `33a05484`. The conflicts were main's input changes: the HUD binding generation and its cache, Sprint's pad state, and the pad product id now used by the vibration code. The built-in-controls rule is unchanged: `pads_read` still hands back whether the Deck's built-in controls gave gameplay input in the same poll as the buttons, and the mouse's gameplay bindings are armed only when they did not. Checks: `tests/run_all.py input` 5 passed; `tests/test_steam_pads.py`, `tests/test_walk_key.py` pass. `tests/run_all.py --changed origin/main` is 47 passed / 4 failed / 4 skipped, and all four also fail on clean `main` here: `test_host_guest_writes`, `test_mods_size_table`, `test_pads_after_menu` (gcc's warning), and `test_sprint`. Still WIP for the one remaining item: a real Deck game run. Press R2 in desktop mode and check it fires once, not the trigger plus the mouse's Y. `testing wanted` and the Deck build are the next step.
HumanBean changed title from WIP: fix(host): the Deck's built-in controls do not also fire the mouse's bindings to fix(host): the Deck's built-in controls do not also fire the mouse's bindings 2026-11-21 01:33:04 +00:00
HumanBean deleted branch deck-builtin-mouse 2026-11-21 01:33:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!1721
No description provided.