From 46a46f74d4969cc9f8607e382dad5a837ff7b75f Mon Sep 17 00:00:00 2001 From: Windsurf7 Date: Fri, 30 Jan 2026 16:40:07 +0300 Subject: [PATCH] Commit suggestion Commit suggestion --- rpcs3/Input/mouse_gyro_state.cpp | 4 ++-- rpcs3/Input/mouse_gyro_state.h | 8 ++++---- rpcs3/Input/pad_thread.cpp | 2 +- rpcs3/rpcs3qt/gs_frame.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rpcs3/Input/mouse_gyro_state.cpp b/rpcs3/Input/mouse_gyro_state.cpp index fa082193aa..319ad56942 100644 --- a/rpcs3/Input/mouse_gyro_state.cpp +++ b/rpcs3/Input/mouse_gyro_state.cpp @@ -44,7 +44,7 @@ void mouse_gyro_state::set_gyro_y(s32 steps) gyro_y = static_cast(std::clamp(gyro_y + steps, 0, DEFAULT_MOTION_Y * 2 - 1)); } -void mouse_gyro_state::gyro_detect(QEvent* ev, const QWindow& win) +void mouse_gyro_state::handle_event(QEvent* ev, const QWindow& win) { // Hardcoded mouse-based motion input. // Captures mouse events while the game window is focused. @@ -107,7 +107,7 @@ void mouse_gyro_state::gyro_detect(QEvent* ev, const QWindow& win) } } -void mouse_gyro_state::gyro_run(const std::shared_ptr& pad) +void mouse_gyro_state::apply_gyro(const std::shared_ptr& pad) { if (!pad || !pad->is_connected()) return; diff --git a/rpcs3/Input/mouse_gyro_state.h b/rpcs3/Input/mouse_gyro_state.h index 44ab25952f..f5001e57b6 100644 --- a/rpcs3/Input/mouse_gyro_state.h +++ b/rpcs3/Input/mouse_gyro_state.h @@ -17,14 +17,14 @@ private: atomic_t gyro_y = DEFAULT_MOTION_Y; // Accumulated from mouse wheel delta atomic_t gyro_z = DEFAULT_MOTION_Z; // Accumulated from mouse Y position relative to center -public: - void clear(); - void set_gyro_active(); void set_gyro_reset(); void set_gyro_xz(s32 off_x, s32 off_y); void set_gyro_y(s32 steps); - void gyro_detect(QEvent* ev, const QWindow& win); +public: + void clear(); + + void handle_event(QEvent* ev, const QWindow& win); void apply_gyro(const std::shared_ptr& pad); }; diff --git a/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp index 27c1d33ee0..53d7f3f178 100644 --- a/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -612,7 +612,7 @@ void pad_thread::operator()() // Inject mouse-based motion sensor values into pad sensors for gyro emulation. // Intentionally bound to Player 1 only. - m_mouse_gyro.gyro_run(m_pads[0]); + m_mouse_gyro.apply_gyro(m_pads[0]); } m_info.now_connect = connected_devices + num_ldd_pad; diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index e93d08ae0a..9d0ce9fbf8 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -1223,7 +1223,7 @@ bool gs_frame::event(QEvent* ev) { if (auto* pad_thr = pad::get_pad_thread(true)) { - pad_thr->m_mouse_gyro.gyro_detect(ev, *this); + pad_thr->m_mouse_gyro.handle_event(ev, *this); } }