Skip to content

Add mouse-based gyro emulation#18113

Merged
Megamouse merged 27 commits intoRPCS3:masterfrom
Windsurf7:master
Feb 2, 2026
Merged

Add mouse-based gyro emulation#18113
Megamouse merged 27 commits intoRPCS3:masterfrom
Windsurf7:master

Conversation

@Windsurf7
Copy link
Contributor

This change adds a hardcoded mouse-based motion sensor emulation feature, inspired by how Cemu handles mouse-driven gyro input.

While the game window is focused, holding the right mouse button enables gyro emulation:

  • Mouse X movement feeds Motion X
  • Mouse Y movement feeds Motion Z
  • Mouse Wheel feeds Motion Y

The axis mapping and behavior were tested with the "Spark Runner" minigame in Sly Cooper: Thieves in Time and Bentley's Hackpack.
In accordance with this minigame, a top-down view motion control scheme relies on the X/Z axes.

While the right mouse button is being held, mouse deltas are captured via the Qt native event filter and accumulated in the frontend, then consumed by the pad thread.
On right mouse button release, motion values are reset to the neutral center to avoid residual drift.

This input path is intentionally independent of pad configuration and works even when a keyboard-only profile is selected.

This implementation thus resolves issue #13883 by allowing motion-only gameplay without requiring a physical motion-capable controller.

This change adds a hardcoded mouse-based motion sensor emulation feature, inspired by how Cemu handles mouse-driven gyro input.

While the game window is focused, holding the right mouse button enables gyro emulation:
- Mouse X movement feeds Motion X
- Mouse Y movement feeds Motion Z
- Mouse Wheel feeds Motion Y

The axis mapping and behavior were tested with the "Spark Runner" minigame in Sly Cooper: Thieves in Time and Bentley's Hackpack.
In accordance with this minigame, a top-down view motion control scheme relies on the X/Z axes.

While the right mouse button is being held, mouse deltas are captured via the Qt native event filter and accumulated in the frontend, then consumed by the pad thread.
On right mouse button release, motion values are reset to the neutral center to avoid residual drift.

This input path is intentionally independent of pad configuration and works even when a keyboard-only profile is selected.

This implementation thus resolves issue RPCS3#13883 by allowing motion-only gameplay without requiring a physical motion-capable controller.
@Windsurf7
Copy link
Contributor Author

Here is a screenshot of the referenced "Spark Runner" minigame that uses motion controls.

sly4sparkrunner

@Pipi86
Copy link

Pipi86 commented Jan 26, 2026

Wouldn't be better if instead mouse movement does x-axis and y-axis, and instead of using the mouse wheel for Z-axis movement you just have a keyboard shortcut to enable this mouse-gyro emulation?; then, pressing/holding left mouse button does backwards movement on Z-axis, while pressing/holding right mouse does fordwards movement, with the speed of movement on Z-axis being adjustable in real time with mouse wheel (something like mouse wheel up= faster - mouse wheel down= slower). In my opinion that would be more confortable, but anyways this is already a very nice addition.

Windsurf7 and others added 5 commits January 27, 2026 11:46
Co-authored-by: Megamouse <studienricky89@googlemail.com>
Co-authored-by: Megamouse <studienricky89@googlemail.com>
Moved events to gs_frame
Merged some lines
Adjusted unnecessary memory order
@Valtekken
Copy link

Great addition. Killzone 2 could be tested further than just the first half hour or so, since the planted explosive charge requires gyro to finish that first level. Thanks!

…o be more correct

Moved mouse gyro to its own struct, adjusted mouse to gyro behavior to be more correct
Some comment fixes
@Windsurf7
Copy link
Contributor Author

@Megamouse I'm done making your requested adjustments. Please review and let me know if you need any more improvements.

Windsurf7 and others added 4 commits January 30, 2026 13:47
Co-authored-by: Megamouse <studienricky89@googlemail.com>
Moved mouse_gyro_state into its own class
Moved qt event part to class too
Made atomic_t
Copy link
Contributor

@Megamouse Megamouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're also still missing the cmakelists addition of the cpp file

Windsurf7 and others added 8 commits January 30, 2026 16:36
Commit suggestion

Co-authored-by: Megamouse <studienricky89@googlemail.com>
Commit suggestion

Co-authored-by: Megamouse <studienricky89@googlemail.com>
Commit suggestion

Co-authored-by: Megamouse <studienricky89@googlemail.com>
Commit suggestion

Co-authored-by: Megamouse <studienricky89@googlemail.com>
Commit suggestion
Commit suggestion
Changed class name
Changed class name
Wrapped to a hotkey
@Megamouse
Copy link
Contributor

You're also still missing the cmakelists addition of the cpp file

Fixed CMakeLists
@Windsurf7
Copy link
Contributor Author

You're also still missing the cmakelists addition of the cpp file

Fixed

Fixed public/private
Cleanup
@Windsurf7
Copy link
Contributor Author

@Megamouse @elad335 Okay, done resolving the requested changes. Ready for another full review.

@Megamouse Megamouse merged commit 588cf69 into RPCS3:master Feb 2, 2026
10 checks passed
@Windsurf7
Copy link
Contributor Author

Thanks for cooperation and merging
Hope this helps people out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants