diff options
Diffstat (limited to 'src/input_common/drivers')
| -rw-r--r-- | src/input_common/drivers/mouse.cpp | 16 | ||||
| -rw-r--r-- | src/input_common/drivers/mouse.h | 6 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp index 7e029d2cdf..00b7220c1e 100644 --- a/src/input_common/drivers/mouse.cpp +++ b/src/input_common/drivers/mouse.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project @@ -72,15 +72,6 @@ Mouse::Mouse(std::string input_engine_) : InputEngine(std::move(input_engine_)) wheel_position = {}; last_mouse_change = {}; last_motion_change = {}; - - update_thread = std::jthread([this](std::stop_token stop_token) { - Common::SetCurrentThreadName("Mouse"); - while (!stop_token.stop_requested()) { - UpdateStickInput(); - UpdateMotionInput(); - std::this_thread::sleep_for(std::chrono::milliseconds(update_time)); - } - }); } void Mouse::UpdateStickInput() { @@ -185,6 +176,11 @@ void Mouse::Move(int x, int y, int center_x, int center_y) { } } +void Mouse::NotifyChanged() { + UpdateStickInput(); + UpdateMotionInput(); +} + void Mouse::MouseMove(f32 touch_x, f32 touch_y) { SetAxis(real_mouse_identifier, mouse_axis_x, touch_x); SetAxis(real_mouse_identifier, mouse_axis_y, touch_y); diff --git a/src/input_common/drivers/mouse.h b/src/input_common/drivers/mouse.h index 2e5e989067..166168c824 100644 --- a/src/input_common/drivers/mouse.h +++ b/src/input_common/drivers/mouse.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project @@ -93,6 +93,9 @@ public: void ReleaseAllButtons(); + /// @brief Notifies we changed something about the mouse state and we must update + void NotifyChanged(); + std::vector<Common::ParamPackage> GetInputDevices() const override; AnalogMapping GetAnalogMappingForDevice(const Common::ParamPackage& params) override; Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override; @@ -110,7 +113,6 @@ private: Common::Vec3<float> last_motion_change; Common::Vec2<int> wheel_position; bool button_pressed = false; - std::jthread update_thread; }; } // namespace InputCommon |
