diff options
author | FearlessTobi <thm.frey@gmail.com> | 2020-07-14 19:01:36 +0200 |
---|---|---|
committer | FearlessTobi <thm.frey@gmail.com> | 2020-08-29 18:56:34 +0200 |
commit | e6bd1fd1b8487e421f71d43b6073ee56de1a043d (patch) | |
tree | 53b383906fae814a67ae270b9b510a60f1b5df9d /src/core/hle/service/hid | |
parent | Merge pull request #4604 from lioncash/lifetime (diff) | |
download | yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar.gz yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar.bz2 yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar.lz yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar.xz yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar.zst yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.zip |
Diffstat (limited to 'src/core/hle/service/hid')
-rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 12 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index e326f8f5c..0df395e85 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -40,9 +40,14 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin cur_entry.sampling_number = last_entry.sampling_number + 1; cur_entry.sampling_number2 = cur_entry.sampling_number; - const auto [x, y, pressed] = touch_device->GetStatus(); + bool pressed = false; + float x, y; + std::tie(x, y, pressed) = touch_device->GetStatus(); auto& touch_entry = cur_entry.states[0]; touch_entry.attribute.raw = 0; + if (!pressed && touch_btn_device) { + std::tie(x, y, pressed) = touch_btn_device->GetStatus(); + } if (pressed && Settings::values.touchscreen.enabled) { touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width); touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height); @@ -63,5 +68,10 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin void Controller_Touchscreen::OnLoadInputDevices() { touch_device = Input::CreateDevice<Input::TouchDevice>(Settings::values.touchscreen.device); + if (Settings::values.use_touch_from_button) { + touch_btn_device = Input::CreateDevice<Input::TouchDevice>("engine:touch_from_button"); + } else { + touch_btn_device.reset(); + } } } // namespace Service::HID diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h index a1d97269e..4d9042adc 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.h +++ b/src/core/hle/service/hid/controllers/touchscreen.h @@ -68,6 +68,7 @@ private: "TouchScreenSharedMemory is an invalid size"); TouchScreenSharedMemory shared_memory{}; std::unique_ptr<Input::TouchDevice> touch_device; + std::unique_ptr<Input::TouchDevice> touch_btn_device; s64_le last_touch{}; }; } // namespace Service::HID |