diff options
| author | 2023-02-22 22:08:35 -0500 | |
|---|---|---|
| committer | 2023-02-22 22:08:35 -0500 | |
| commit | ca8a804a3c28f53bba9d1f9080ae15c13f60ce9c (patch) | |
| tree | ac8c6c62c2f43c41e887b269520c6d2482cf95a2 /src/core/hle/service | |
| parent | Merge pull request #9847 from german77/timeout (diff) | |
| parent | settings: Add more input settings to the log (diff) | |
| download | yuzu-ca8a804a3c28f53bba9d1f9080ae15c13f60ce9c.tar.gz yuzu-ca8a804a3c28f53bba9d1f9080ae15c13f60ce9c.tar.xz yuzu-ca8a804a3c28f53bba9d1f9080ae15c13f60ce9c.zip | |
Merge pull request #9842 from german77/proper_real_mouse
core: hid: Fix native mouse mapping
Diffstat (limited to 'src/core/hle/service')
| -rw-r--r-- | src/core/hle/service/hid/controllers/gesture.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/mouse.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 5 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index 32e0708ba..de0090cc5 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp | |||
| @@ -65,6 +65,11 @@ void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing) { | |||
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | void Controller_Gesture::ReadTouchInput() { | 67 | void Controller_Gesture::ReadTouchInput() { |
| 68 | if (!Settings::values.touchscreen.enabled) { | ||
| 69 | fingers = {}; | ||
| 70 | return; | ||
| 71 | } | ||
| 72 | |||
| 68 | const auto touch_status = console->GetTouch(); | 73 | const auto touch_status = console->GetTouch(); |
| 69 | for (std::size_t id = 0; id < fingers.size(); ++id) { | 74 | for (std::size_t id = 0; id < fingers.size(); ++id) { |
| 70 | fingers[id] = touch_status[id]; | 75 | fingers[id] = touch_status[id]; |
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp index b11cb438d..0afc66681 100644 --- a/src/core/hle/service/hid/controllers/mouse.cpp +++ b/src/core/hle/service/hid/controllers/mouse.cpp | |||
| @@ -33,10 +33,11 @@ void Controller_Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing) { | |||
| 33 | return; | 33 | return; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | next_state = {}; | ||
| 37 | |||
| 36 | const auto& last_entry = shared_memory->mouse_lifo.ReadCurrentEntry().state; | 38 | const auto& last_entry = shared_memory->mouse_lifo.ReadCurrentEntry().state; |
| 37 | next_state.sampling_number = last_entry.sampling_number + 1; | 39 | next_state.sampling_number = last_entry.sampling_number + 1; |
| 38 | 40 | ||
| 39 | next_state.attribute.raw = 0; | ||
| 40 | if (Settings::values.mouse_enabled) { | 41 | if (Settings::values.mouse_enabled) { |
| 41 | const auto& mouse_button_state = emulated_devices->GetMouseButtons(); | 42 | const auto& mouse_button_state = emulated_devices->GetMouseButtons(); |
| 42 | const auto& mouse_position_state = emulated_devices->GetMousePosition(); | 43 | const auto& mouse_position_state = emulated_devices->GetMousePosition(); |
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index 1da8d3eb0..d90a4e732 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp | |||
| @@ -58,6 +58,11 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin | |||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | if (!finger.pressed && current_touch.pressed) { | 60 | if (!finger.pressed && current_touch.pressed) { |
| 61 | // Ignore all touch fingers if disabled | ||
| 62 | if (!Settings::values.touchscreen.enabled) { | ||
| 63 | continue; | ||
| 64 | } | ||
| 65 | |||
| 61 | finger.attribute.start_touch.Assign(1); | 66 | finger.attribute.start_touch.Assign(1); |
| 62 | finger.pressed = true; | 67 | finger.pressed = true; |
| 63 | finger.position = current_touch.position; | 68 | finger.position = current_touch.position; |