summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/mouse.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-15 04:28:38 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:28 +0100
commitf4e5f89e6fb9d68cd4ba7d98c281584c50f0e149 (patch)
tree9e9f9114d9b7528e74e78102279411595632f048 /src/core/hle/service/hid/controllers/mouse.cpp
parentcore/hid: Fully implement native mouse (diff)
downloadyuzu-f4e5f89e6fb9d68cd4ba7d98c281584c50f0e149.tar
yuzu-f4e5f89e6fb9d68cd4ba7d98c281584c50f0e149.tar.gz
yuzu-f4e5f89e6fb9d68cd4ba7d98c281584c50f0e149.tar.bz2
yuzu-f4e5f89e6fb9d68cd4ba7d98c281584c50f0e149.tar.lz
yuzu-f4e5f89e6fb9d68cd4ba7d98c281584c50f0e149.tar.xz
yuzu-f4e5f89e6fb9d68cd4ba7d98c281584c50f0e149.tar.zst
yuzu-f4e5f89e6fb9d68cd4ba7d98c281584c50f0e149.zip
Diffstat (limited to 'src/core/hle/service/hid/controllers/mouse.cpp')
-rw-r--r--src/core/hle/service/hid/controllers/mouse.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp
index 9c408e7f4..ba79888ae 100644
--- a/src/core/hle/service/hid/controllers/mouse.cpp
+++ b/src/core/hle/service/hid/controllers/mouse.cpp
@@ -38,15 +38,16 @@ void Controller_Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
if (Settings::values.mouse_enabled) {
const auto& mouse_button_state = emulated_devices->GetMouseButtons();
const auto& mouse_position_state = emulated_devices->GetMousePosition();
- const auto& mouse_wheel_state = emulated_devices->GetMouseDeltaWheel();
+ const auto& mouse_wheel_state = emulated_devices->GetMouseWheel();
next_state.attribute.is_connected.Assign(1);
next_state.x = static_cast<s32>(mouse_position_state.x * Layout::ScreenUndocked::Width);
next_state.y = static_cast<s32>(mouse_position_state.y * Layout::ScreenUndocked::Height);
next_state.delta_x = next_state.x - last_entry.x;
next_state.delta_y = next_state.y - last_entry.y;
- next_state.delta_wheel_x = mouse_wheel_state.x;
- next_state.delta_wheel_y = mouse_wheel_state.y;
+ next_state.delta_wheel_x = mouse_wheel_state.x - last_mouse_wheel_state.x;
+ next_state.delta_wheel_y = mouse_wheel_state.y - last_mouse_wheel_state.y;
+ last_mouse_wheel_state = mouse_wheel_state;
next_state.button = mouse_button_state;
}