diff options
| author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-05-02 23:25:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-02 23:25:10 -0400 |
| commit | abf7bc52b4ee76e546f5bdb6c2ea999cf43a2ea6 (patch) | |
| tree | 028dbe810df83d0bfa23f549095bf54646792ecb /src/core | |
| parent | 887972a91b9533bfce789c323400f37a0d8a3a9a (diff) | |
| parent | 86f05024562de4ed5b4a23fb3a57c105780cd1d0 (diff) | |
Merge pull request #6277 from german77/touchsetting2
hid: Fix touch not initializing properly if disabled
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/hid/controllers/gesture.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index 71545bf1fe..69708c79d0 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp @@ -33,7 +33,7 @@ void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing, u shared_memory.header.timestamp = core_timing.GetCPUTicks(); shared_memory.header.total_entry_count = 17; - if (!IsControllerActivated() || !Settings::values.touchscreen.enabled) { + if (!IsControllerActivated()) { shared_memory.header.entry_count = 0; shared_memory.header.last_entry_index = 0; return; @@ -129,6 +129,10 @@ void Controller_Gesture::OnLoadInputDevices() { } std::optional<std::size_t> Controller_Gesture::GetUnusedFingerID() const { + // Dont assign any touch input to a point if disabled + if (!Settings::values.touchscreen.enabled) { + return std::nullopt; + } std::size_t first_free_id = 0; while (first_free_id < MAX_POINTS) { if (!fingers[first_free_id].pressed) { diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index 8f56a02551..55e3cc014c 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -33,7 +33,7 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin shared_memory.header.timestamp = core_timing.GetCPUTicks(); shared_memory.header.total_entry_count = 17; - if (!IsControllerActivated() || !Settings::values.touchscreen.enabled) { + if (!IsControllerActivated()) { shared_memory.header.entry_count = 0; shared_memory.header.last_entry_index = 0; return; @@ -105,6 +105,10 @@ void Controller_Touchscreen::OnLoadInputDevices() { } std::optional<std::size_t> Controller_Touchscreen::GetUnusedFingerID() const { + // Dont assign any touch input to a finger if disabled + if (!Settings::values.touchscreen.enabled) { + return std::nullopt; + } std::size_t first_free_id = 0; while (first_free_id < MAX_FINGERS) { if (!fingers[first_free_id].pressed) { |
