From 390ee10eefea4249aff94eb5351a908e3cafe228 Mon Sep 17 00:00:00 2001 From: german Date: Fri, 1 Jan 2021 10:40:02 -0600 Subject: Allow all touch inputs at the same time and remove config options that are not longer necesary --- src/core/hle/service/hid/controllers/touchscreen.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/hid/controllers/touchscreen.h') diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h index 6c7620420..03f399344 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.h +++ b/src/core/hle/service/hid/controllers/touchscreen.h @@ -30,7 +30,12 @@ public: void OnLoadInputDevices() override; private: - void updateTouchInputEvent(const std::tuple& touch_input, int& finger_id); + // If the touch is new it tries to assing a new finger id, if there is no fingers avaliable no + // changes will be made. Updates the coordinates if the finger id it's already set. If the touch + // ends delays the output by one frame to set the end_touch flag before finally freeing the + // finger id + void updateTouchInputEvent(const std::tuple& touch_input, + size_t& finger_id); static const size_t MAX_FINGERS = 16; struct Attributes { @@ -80,10 +85,12 @@ private: }; TouchScreenSharedMemory shared_memory{}; - std::unique_ptr touch_device; + std::unique_ptr touch_mouse_device; + std::unique_ptr touch_udp_device; std::unique_ptr touch_btn_device; - int mouse_finger_id{-1}; - int keyboar_finger_id{-1}; + size_t mouse_finger_id{-1}; + size_t keyboard_finger_id{-1}; + size_t udp_finger_id{-1}; std::array fingers; }; } // namespace Service::HID -- cgit v1.2.3