libSceVideoOut: ToggleMouse does not keep the cursor captured; MouseInput::UpdateCapture turns relative mode off every frame (since #4217) #6147
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by HQasper on 2026-10-14T23:29:44Z.
Summary
With
ToggleMouse(mouse-to-right-stick) enabled, the host cursor stays visible and is not confined to the window. Camera control stops as soon as the cursor leaves the window.MouseInput::UpdateCaptureturns off the relative mouse mode thatPadInput::setMouseModehas just turned on.Cause
PadInput::setMouseMode(true)enables SDL relative mouse mode (PadInput.cpp#L119).On every iteration of the present loop, the driver then calls
mouseInput.UpdateCapture(!padInput.MouseModeEnabled())(VideoOutDriver.cpp#L683). With mouse mode on,allowedisfalse, sowantedisfalse.capturedisfalsebecause the title never opened a mouse, butSDL_GetRelativeMouseMode()is nowSDL_TRUE. The early return in MouseInput.cpp#L86 is not taken, and L87 callsSDL_SetRelativeMouseMode(SDL_FALSE):KeyboardMouse::MouseMode()staystrue, so mouse motion still drives the right stick. The motion comes from absolute cursor deltas, however, and they stop when the cursor leaves the window or reaches the edge of the screen.This was introduced by #4217, which added guest-mouse capture and "releases it otherwise", including while the mouse-to-stick toggle is on. The same code is in
v0.1.2(VideoOutDriver.cpp#L626).Steps to reproduce
sceMouseOpen) and uses the right stick for the camera.ToggleMouse).Expected: The cursor is hidden and confined, and the right stick follows raw relative motion without limit, as described in INPUT_MAPPING.md.
Actual: The cursor stays visible and moves freely. The camera turns only while the cursor is inside the window and stops at the window edge, or at the screen edge in fullscreen (F11).
Suggested fix
While mouse-to-stick owns relative mode,
UpdateCaptureleaves it alone:The existing
CaptureAppliedcheck intests/MouseInput.cppcallsUpdateCapture(false)and expects the capture to be released, so it encodes the current behaviour and needs to change with the fix. A branch with the fix and an updated test is ready if a pull request is preferred.PadInput::setMouseMode(false)already disables relative mode when the toggle is turned off. On the next iteration,UpdateCapture(true)captures the cursor again if the title has a mouse open.Tested: this change, built into
libSceVideoOut.prxfromv0.1.2(WinLibs GCC 15.2.0), fixes it in Superliminal. With the toggle on, the cursor is hidden and confined, and the camera turns without limit. Titles that open a guest mouse were not tested.Environment
v0.1.2(relinker-v0.1.2.exe,prx-windows-v0.1.2). The code above was also checked onmain@4808d9c.anyps5-input.ini:ToggleMouse = MOUSE:Middle,ToggleMouse = KEY:F1, plus mouse tuning settings. Mapping is not involved; the toggle fires.Done with AI assistance.