[PR #3122] [MERGED] Emulate motion controls with a mouse #3241

Closed
opened 2026-02-27 22:02:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3122
Author: @kalaposfos13
Created: 6/19/2025
Status: Merged
Merged: 6/20/2025
Merged by: @georgemoralis

Base: mainHead: mouse-gyro


📝 Commits (7)

  • b3dd428 Rework framework to allow for more types of mouse-to-something emulation and hook up gyro to it
  • a708e28 Remove the unnecessary null check now that deltatime is handled differently
  • e1a40b6 Fix toggle key
  • f4653d4 Basic gyro emulation working for two out of the three dimensions
  • 32edcd4 clang
  • add4371 Added bindable key to hold for switching from looking to the sides to rolling
  • 1df9d89 documentation

📊 Changes

7 files changed (+88 additions, -30 deletions)

View changed files

📝 src/core/libraries/pad/pad.cpp (+12 -15)
📝 src/input/input_handler.cpp (+4 -0)
📝 src/input/input_handler.h (+2 -0)
📝 src/input/input_mouse.cpp (+46 -9)
📝 src/input/input_mouse.h (+12 -2)
📝 src/qt_gui/kbm_help_dialog.h (+4 -1)
📝 src/sdl_window.cpp (+8 -3)

📄 Description

Adds the ability to emulate motion control inputs via a mouse. Since a gyroscope is a three-dimensional sensor, while a mouse is only two-dimensional, the full range of controls is achieved by having a (rebindable) toggle key to switch the behaviour of moving the mouse sideways between panning and rolling. While this is active, acceleration is spoofed to a constant downwards direction.

To enable it, press F6. You can also seamlessly switch between joystick and gyro emulation, if you select one while the other is active, it will cleanly switch modes, and if you press the toggle for the currently active mode, it will turn off.

The name for the keybind that switches between panning and rolling is mouse_gyro_roll_mode.

This is only the backend code and since this seems to be true for almost every PR I make, I think it will stay that way and I will pass off integrating it into the frontend to someone else.

Since it's using the same setup as joystick emulation, this is also conflicting with gyro data coming from a connected controller the same way joystick data does.

I only tested it with Gravity Rush 2, so further testing is very welcome.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3122 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 6/19/2025 **Status:** ✅ Merged **Merged:** 6/20/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `mouse-gyro` --- ### 📝 Commits (7) - [`b3dd428`](https://github.com/shadps4-emu/shadPS4/commit/b3dd4282431575077aed5b40f3f798518c0b321e) Rework framework to allow for more types of mouse-to-something emulation and hook up gyro to it - [`a708e28`](https://github.com/shadps4-emu/shadPS4/commit/a708e284015232d259350e8c0ac228df27b45314) Remove the unnecessary null check now that deltatime is handled differently - [`e1a40b6`](https://github.com/shadps4-emu/shadPS4/commit/e1a40b65aa7321b935f0f76422a655be732c5e2f) Fix toggle key - [`f4653d4`](https://github.com/shadps4-emu/shadPS4/commit/f4653d40cf08cc51298c4ba07dc4bc3dfddea91b) Basic gyro emulation working for two out of the three dimensions - [`32edcd4`](https://github.com/shadps4-emu/shadPS4/commit/32edcd4301596f5c93e865c3ab96a52379a4a156) clang - [`add4371`](https://github.com/shadps4-emu/shadPS4/commit/add437158b8cf8ae44a82b392308eb4baef610c2) Added bindable key to hold for switching from looking to the sides to rolling - [`1df9d89`](https://github.com/shadps4-emu/shadPS4/commit/1df9d89223fdccf9dd826f02cec99f9c47dd3477) documentation ### 📊 Changes **7 files changed** (+88 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/pad/pad.cpp` (+12 -15) 📝 `src/input/input_handler.cpp` (+4 -0) 📝 `src/input/input_handler.h` (+2 -0) 📝 `src/input/input_mouse.cpp` (+46 -9) 📝 `src/input/input_mouse.h` (+12 -2) 📝 `src/qt_gui/kbm_help_dialog.h` (+4 -1) 📝 `src/sdl_window.cpp` (+8 -3) </details> ### 📄 Description Adds the ability to emulate motion control inputs via a mouse. Since a gyroscope is a three-dimensional sensor, while a mouse is only two-dimensional, the full range of controls is achieved by having a (rebindable) toggle key to switch the behaviour of moving the mouse sideways between panning and rolling. While this is active, acceleration is spoofed to a constant downwards direction. To enable it, press F6. You can also seamlessly switch between joystick and gyro emulation, if you select one while the other is active, it will cleanly switch modes, and if you press the toggle for the currently active mode, it will turn off. The name for the keybind that switches between panning and rolling is `mouse_gyro_roll_mode`. This is only the backend code and since this seems to be true for almost every PR I make, I think it will stay that way and I will pass off integrating it into the frontend to someone else. Since it's using the same setup as joystick emulation, this is also conflicting with gyro data coming from a connected controller the same way joystick data does. I only tested it with Gravity Rush 2, so further testing is very welcome. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:57 +03:00
Sign in to join this conversation.
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
starred/shadPS4#3241
No description provided.