summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/touchscreen.h
diff options
context:
space:
mode:
authorgerman <german@thesoftwareartisans.com>2021-01-01 03:40:55 +0100
committergerman <german@thesoftwareartisans.com>2021-01-15 16:03:39 +0100
commitd583e01f54a7f53d1955f8bc76169c02b807df2e (patch)
treeb61585bd2d24956c982f9de49fb1a7fe640ddaf5 /src/core/hle/service/hid/controllers/touchscreen.h
parentMerge pull request #5357 from ReinUsesLisp/alignment-log2 (diff)
downloadyuzu-d583e01f54a7f53d1955f8bc76169c02b807df2e.tar
yuzu-d583e01f54a7f53d1955f8bc76169c02b807df2e.tar.gz
yuzu-d583e01f54a7f53d1955f8bc76169c02b807df2e.tar.bz2
yuzu-d583e01f54a7f53d1955f8bc76169c02b807df2e.tar.lz
yuzu-d583e01f54a7f53d1955f8bc76169c02b807df2e.tar.xz
yuzu-d583e01f54a7f53d1955f8bc76169c02b807df2e.tar.zst
yuzu-d583e01f54a7f53d1955f8bc76169c02b807df2e.zip
Diffstat (limited to 'src/core/hle/service/hid/controllers/touchscreen.h')
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h
index 4d9042adc..6c7620420 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.h
+++ b/src/core/hle/service/hid/controllers/touchscreen.h
@@ -30,6 +30,9 @@ public:
void OnLoadInputDevices() override;
private:
+ void updateTouchInputEvent(const std::tuple<float, float, bool>& touch_input, int& finger_id);
+ static const size_t MAX_FINGERS = 16;
+
struct Attributes {
union {
u32 raw{};
@@ -55,7 +58,7 @@ private:
s64_le sampling_number;
s64_le sampling_number2;
s32_le entry_count;
- std::array<TouchState, 16> states;
+ std::array<TouchState, MAX_FINGERS> states;
};
static_assert(sizeof(TouchScreenEntry) == 0x298, "TouchScreenEntry is an invalid size");
@@ -66,9 +69,21 @@ private:
};
static_assert(sizeof(TouchScreenSharedMemory) == 0x3000,
"TouchScreenSharedMemory is an invalid size");
+
+ struct Finger {
+ u64_le last_touch{};
+ float x{};
+ float y{};
+ u32_le id{};
+ bool pressed{};
+ Attributes attribute;
+ };
+
TouchScreenSharedMemory shared_memory{};
std::unique_ptr<Input::TouchDevice> touch_device;
std::unique_ptr<Input::TouchDevice> touch_btn_device;
- s64_le last_touch{};
+ int mouse_finger_id{-1};
+ int keyboar_finger_id{-1};
+ std::array<Finger, MAX_FINGERS> fingers;
};
} // namespace Service::HID