diff options
author | german <german@thesoftwareartisans.com> | 2021-01-01 17:40:02 +0100 |
---|---|---|
committer | german <german@thesoftwareartisans.com> | 2021-01-15 16:05:17 +0100 |
commit | 390ee10eefea4249aff94eb5351a908e3cafe228 (patch) | |
tree | 075185209ebab612070fed9066269272557e41c4 /src/core/hle/service/hid/controllers/touchscreen.h | |
parent | Add multitouch support (diff) | |
download | yuzu-390ee10eefea4249aff94eb5351a908e3cafe228.tar yuzu-390ee10eefea4249aff94eb5351a908e3cafe228.tar.gz yuzu-390ee10eefea4249aff94eb5351a908e3cafe228.tar.bz2 yuzu-390ee10eefea4249aff94eb5351a908e3cafe228.tar.lz yuzu-390ee10eefea4249aff94eb5351a908e3cafe228.tar.xz yuzu-390ee10eefea4249aff94eb5351a908e3cafe228.tar.zst yuzu-390ee10eefea4249aff94eb5351a908e3cafe228.zip |
Diffstat (limited to 'src/core/hle/service/hid/controllers/touchscreen.h')
-rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.h | 15 |
1 files changed, 11 insertions, 4 deletions
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<float, float, bool>& 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<float, float, bool>& 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<Input::TouchDevice> touch_device; + std::unique_ptr<Input::TouchDevice> touch_mouse_device; + std::unique_ptr<Input::TouchDevice> touch_udp_device; std::unique_ptr<Input::TouchDevice> 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<Finger, MAX_FINGERS> fingers; }; } // namespace Service::HID |