diff options
author | german77 <juangerman-13@hotmail.com> | 2021-11-14 21:09:29 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2021-11-25 03:30:28 +0100 |
commit | 654d76e79e84a3384fa503fac9003a5d0a32f28b (patch) | |
tree | 7a0d436a55aa73401d7b77bae4870c10ceca16cd /src/core/hle | |
parent | input_common: Allow keyboard to be backwards compatible (diff) | |
download | yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.gz yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.bz2 yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.lz yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.xz yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.zst yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/service/hid/controllers/mouse.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp index 83e69ca94..9c408e7f4 100644 --- a/src/core/hle/service/hid/controllers/mouse.cpp +++ b/src/core/hle/service/hid/controllers/mouse.cpp @@ -38,13 +38,14 @@ 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(); next_state.attribute.is_connected.Assign(1); - next_state.x = mouse_position_state.x; - next_state.y = mouse_position_state.y; + 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_position_state.delta_wheel_x; - next_state.delta_wheel_y = mouse_position_state.delta_wheel_y; + next_state.delta_wheel_x = mouse_wheel_state.x; + next_state.delta_wheel_y = mouse_wheel_state.y; next_state.button = mouse_button_state; } |