diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-07-26 05:11:03 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-07-26 05:11:03 +0200 |
| commit | 39763e7321fa17486f1b466a1777f8aa4a91949f (patch) | |
| tree | 19b0481fb690bea4852705d3c0e760c12fa313ac /src/input_common | |
| parent | e69415c07bd06a2a26faac8bf343b883541a1006 (diff) | |
[core/hle/services/am] nuke ButtonPoller and Mouse thread (#4229)
Signed-off-by: lizzie <lizzie@eden-emu.dev>
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
-------------------
doesn't even do anything now, please check if controller i/o is affected by this change
this should also fix latency issues with the mouse
the ButtonPoller thread isn't longer required since we update the state immediately with the .on_change callback registered
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4229
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'src/input_common')
| -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 |
