Commit suggestion

Commit suggestion
This commit is contained in:
Windsurf7 2026-01-30 16:40:07 +03:00
parent c5139d12e6
commit 46a46f74d4
4 changed files with 8 additions and 8 deletions

View File

@ -44,7 +44,7 @@ void mouse_gyro_state::set_gyro_y(s32 steps)
gyro_y = static_cast<u16>(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>& pad)
void mouse_gyro_state::apply_gyro(const std::shared_ptr<Pad>& pad)
{
if (!pad || !pad->is_connected())
return;

View File

@ -17,14 +17,14 @@ private:
atomic_t<s32> gyro_y = DEFAULT_MOTION_Y; // Accumulated from mouse wheel delta
atomic_t<s32> 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>& pad);
};

View File

@ -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;

View File

@ -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);
}
}