diff options
author | german <german@thesoftwareartisans.com> | 2021-01-10 15:36:31 +0100 |
---|---|---|
committer | german <german@thesoftwareartisans.com> | 2021-01-15 16:05:17 +0100 |
commit | b483f2d010bf745ab873e8f8bfaca5515e56d39f (patch) | |
tree | d14bc19b4ca1c60460a941db612195be12f16b0d /src/core | |
parent | Add mutitouch support for touch screens (diff) | |
download | yuzu-b483f2d010bf745ab873e8f8bfaca5515e56d39f.tar yuzu-b483f2d010bf745ab873e8f8bfaca5515e56d39f.tar.gz yuzu-b483f2d010bf745ab873e8f8bfaca5515e56d39f.tar.bz2 yuzu-b483f2d010bf745ab873e8f8bfaca5515e56d39f.tar.lz yuzu-b483f2d010bf745ab873e8f8bfaca5515e56d39f.tar.xz yuzu-b483f2d010bf745ab873e8f8bfaca5515e56d39f.tar.zst yuzu-b483f2d010bf745ab873e8f8bfaca5515e56d39f.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/frontend/emu_window.cpp | 5 | ||||
-rw-r--r-- | src/core/frontend/emu_window.h | 9 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 6 |
3 files changed, 8 insertions, 12 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index af6c1633a..ee7a58b1c 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -28,12 +28,11 @@ private: public: explicit Device(std::weak_ptr<TouchState>&& touch_state) : touch_state(touch_state) {} Input::TouchStatus GetStatus() const override { - Input::TouchStatus touch_status{}; if (auto state = touch_state.lock()) { std::lock_guard guard{state->mutex}; - touch_status = state->status; + return state->status; } - return touch_status; + return {}; } private: diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index f8db42ab4..2436c6580 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h @@ -117,12 +117,13 @@ public: * Signal that a touch pressed event has occurred (e.g. mouse click pressed) * @param framebuffer_x Framebuffer x-coordinate that was pressed * @param framebuffer_y Framebuffer y-coordinate that was pressed - * @param id Touch event id + * @param id Touch event ID */ void TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id); - /** Signal that a touch released event has occurred (e.g. mouse click released) - *@param id Touch event id + /** + * Signal that a touch released event has occurred (e.g. mouse click released) + * @param id Touch event ID */ void TouchReleased(std::size_t id); @@ -130,7 +131,7 @@ public: * Signal that a touch movement event has occurred (e.g. mouse was moved over the emu window) * @param framebuffer_x Framebuffer x-coordinate * @param framebuffer_y Framebuffer y-coordinate - * @param id Touch event id + * @param id Touch event ID */ void TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id); diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index cd318f25b..5219f2dad 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -100,11 +100,7 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin void Controller_Touchscreen::OnLoadInputDevices() { touch_mouse_device = Input::CreateDevice<Input::TouchDevice>("engine:emu_window"); touch_udp_device = Input::CreateDevice<Input::TouchDevice>("engine:cemuhookudp"); - if (Settings::values.use_touch_from_button) { - touch_btn_device = Input::CreateDevice<Input::TouchDevice>("engine:touch_from_button"); - } else { - touch_btn_device.reset(); - } + touch_btn_device = Input::CreateDevice<Input::TouchDevice>("engine:touch_from_button"); } std::optional<std::size_t> Controller_Touchscreen::GetUnusedFingerID() const { |