fix(libSceVideoOut): preserve mouse-to-stick relative mode #6153

Merged
MarcZX10 merged 1 commit from upstream-pr/6153 into main 2026-10-17 01:36:50 +00:00
MarcZX10 commented 2026-10-14 23:41:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T23:41:14Z.


What

Fixes #6147. When the pad's mouse-to-stick mode owns SDL relative mouse mode, MouseInput::UpdateCapture(false) now clears guest capture bookkeeping without disabling the SDL mode. The mouse input test covers that handoff and restoration of guest capture when mouse-to-stick mode ends.

The issue analysis and suggested guard came from @HQasper; this PR credits their report and proposed fix.

Tested

  • Linux x86-64, GCC 12.2, Ninja: video_out_mouse_tests built successfully.
  • A standalone SDL dummy-driver handoff check passed with the change and failed against the old implementation as expected.
  • ctest --test-dir /tmp/anyps5-open-diagnostics-main-build -R '^video_out_mouse$' --output-on-failure could not reach the test body because the existing HostCpu check rejects this Xeon E5-1620 v2 host (missing LZCNT, BMI1/2, MOVBE, AVX2 and FMA).
  • The issue reporter separately reports testing the fix with Superliminal (PPSA06084) on Windows 11.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866031870 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6153). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T23:41:14Z. --- ### What Fixes #6147. When the pad's mouse-to-stick mode owns SDL relative mouse mode, `MouseInput::UpdateCapture(false)` now clears guest capture bookkeeping without disabling the SDL mode. The mouse input test covers that handoff and restoration of guest capture when mouse-to-stick mode ends. The issue analysis and suggested guard came from @HQasper; this PR credits their report and proposed fix. ### Tested - Linux x86-64, GCC 12.2, Ninja: `video_out_mouse_tests` built successfully. - A standalone SDL dummy-driver handoff check passed with the change and failed against the old implementation as expected. - `ctest --test-dir /tmp/anyps5-open-diagnostics-main-build -R '^video_out_mouse$' --output-on-failure` could not reach the test body because the existing HostCpu check rejects this Xeon E5-1620 v2 host (missing LZCNT, BMI1/2, MOVBE, AVX2 and FMA). - The issue reporter separately reports testing the fix with Superliminal (PPSA06084) on Windows 11. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
coltken95 commented 2026-10-15 00:19:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-15T00:19:37Z.


Tested on Linux x86-64 (Release build), with df4350f3a merged into main ab9a47684. The HostCpu check passes on this host, so video_out_mouse runs to completion:

  • With the PR: video_out_mouse passes.
  • With main's MouseInput.cpp: it aborts with mouse input: mouse-to-stick mode lost relative mouse mode.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181419503 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6153#issuecomment-6181419503). Originally posted by [coltken95](https://github.com/coltken95) on 2026-10-15T00:19:37Z. --- Tested on Linux x86-64 (Release build), with df4350f3a merged into main ab9a47684. The HostCpu check passes on this host, so `video_out_mouse` runs to completion: - With the PR: `video_out_mouse` passes. - With main's `MouseInput.cpp`: it aborts with `mouse input: mouse-to-stick mode lost relative mouse mode`. AI-assisted: yes (Claude Code)
Tamalero commented 2026-10-16 05:37:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-16T05:37:03Z.


Title evidence for this change (and #6195, which makes the same UpdateCapture change): LEGO Batman: Legacy of the Dark Knight (PPSA16833 v01.010.000) needs the right stick for the camera in gameplay, so ToggleMouse is the only way to look around with a keyboard and mouse.

Two runs of the same build, with and without this PR's MouseInput.cpp change (identical to this branch's; nothing else differs between the runs):

Build ToggleMouse in gameplay
without the change the cursor isn't kept: the camera turns a little, then the mouse leaves the window and stops driving the stick (#6147)
with the change clicking the window captures the mouse, it stays inside the window, and mouse movement turns the camera freely
Details

Linux (CachyOS), RTX 4090, i9-14900K, GCC, Release. Base main 5d9dcc42d, plus the changes this title needs to reach gameplay (#6688, the Terms of Service part of #6447, the sampler capacity from #6699) and the #6569 input change. Those are the same in both runs. The title was relinked with --to-intel by the relinker at 5d9dcc42d. One run each.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208881497 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6153#issuecomment-6208881497). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-16T05:37:03Z. --- Title evidence for this change (and #6195, which makes the same `UpdateCapture` change): LEGO Batman: Legacy of the Dark Knight (PPSA16833 v01.010.000) needs the right stick for the camera in gameplay, so ToggleMouse is the only way to look around with a keyboard and mouse. Two runs of the same build, with and without this PR's `MouseInput.cpp` change (identical to this branch's; nothing else differs between the runs): | Build | ToggleMouse in gameplay | |---|---| | without the change | the cursor isn't kept: the camera turns a little, then the mouse leaves the window and stops driving the stick (#6147) | | with the change | clicking the window captures the mouse, it stays inside the window, and mouse movement turns the camera freely | <details><summary>Details</summary> Linux (CachyOS), RTX 4090, i9-14900K, GCC, Release. Base `main` `5d9dcc42d`, plus the changes this title needs to reach gameplay (#6688, the Terms of Service part of #6447, the sampler capacity from #6699) and the #6569 input change. Those are the same in both runs. The title was relinked with `--to-intel` by the relinker at `5d9dcc42d`. One run each. </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
MarcZX10 commented 2026-10-16 15:34:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:34:21Z.


Thanks for the controlled LEGO Batman runs. I checked the open overlap: #6195 carries the same UpdateCapture change, and your title result validates that shared behavior. The independent Linux test on #6153 also shows the relative-mode regression against main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6218948112 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6153#issuecomment-6218948112). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T15:34:21Z. --- Thanks for the controlled LEGO Batman runs. I checked the open overlap: #6195 carries the same `UpdateCapture` change, and your title result validates that shared behavior. The independent Linux test on #6153 also shows the relative-mode regression against main.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
boykopovar/AnyPS5!6153
No description provided.