diff options
| author | 2021-09-20 17:20:56 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:22 -0600 | |
| commit | fa8e23b84281022bf6b4e8916231a17e9997e5aa (patch) | |
| tree | d74ffb84e5c2e391963db69bcdfb94be42edeac1 /src/input_common/drivers/touch_screen.h | |
| parent | input_common: Rewrite mouse (diff) | |
| download | yuzu-fa8e23b84281022bf6b4e8916231a17e9997e5aa.tar.gz yuzu-fa8e23b84281022bf6b4e8916231a17e9997e5aa.tar.xz yuzu-fa8e23b84281022bf6b4e8916231a17e9997e5aa.zip | |
input_common: Rewrite touch
Diffstat (limited to 'src/input_common/drivers/touch_screen.h')
| -rw-r--r-- | src/input_common/drivers/touch_screen.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/input_common/drivers/touch_screen.h b/src/input_common/drivers/touch_screen.h new file mode 100644 index 000000000..5fbb2f47f --- /dev/null +++ b/src/input_common/drivers/touch_screen.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "input_common/input_engine.h" | ||
| 8 | |||
| 9 | namespace InputCommon { | ||
| 10 | |||
| 11 | /** | ||
| 12 | * A button device factory representing a keyboard. It receives keyboard events and forward them | ||
| 13 | * to all button devices it created. | ||
| 14 | */ | ||
| 15 | class TouchScreen final : public InputCommon::InputEngine { | ||
| 16 | public: | ||
| 17 | explicit TouchScreen(const std::string input_engine_); | ||
| 18 | |||
| 19 | /** | ||
| 20 | * Signals that mouse has moved. | ||
| 21 | * @param x the x-coordinate of the cursor | ||
| 22 | * @param y the y-coordinate of the cursor | ||
| 23 | * @param center_x the x-coordinate of the middle of the screen | ||
| 24 | * @param center_y the y-coordinate of the middle of the screen | ||
| 25 | */ | ||
| 26 | void TouchMoved(float x, float y, std::size_t finger); | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Sets the status of all buttons bound with the key to pressed | ||
| 30 | * @param key_code the code of the key to press | ||
| 31 | */ | ||
| 32 | void TouchPressed(float x, float y, std::size_t finger); | ||
| 33 | |||
| 34 | /** | ||
| 35 | * Sets the status of all buttons bound with the key to released | ||
| 36 | * @param key_code the code of the key to release | ||
| 37 | */ | ||
| 38 | void TouchReleased(std::size_t finger); | ||
| 39 | |||
| 40 | void ReleaseAllTouch(); | ||
| 41 | |||
| 42 | private: | ||
| 43 | const PadIdentifier identifier = { | ||
| 44 | .guid = Common::UUID{""}, | ||
| 45 | .port = 0, | ||
| 46 | .pad = 0, | ||
| 47 | }; | ||
| 48 | }; | ||
| 49 | |||
| 50 | } // namespace InputCommon | ||