diff options
| author | 2022-05-27 12:16:03 -0700 | |
|---|---|---|
| committer | 2022-05-27 12:16:03 -0700 | |
| commit | 439e6216740f0ad01e88978147f02f70d182f498 (patch) | |
| tree | 3873d1660b42dcb17fdacd01990500055495d3ae /src/core/hid/input_converter.cpp | |
| parent | Merge pull request #8381 from lat9nq/path-util-pointer-bool (diff) | |
| parent | input_common: touch: Rewrite touch driver to support multiple touch points (diff) | |
| download | yuzu-439e6216740f0ad01e88978147f02f70d182f498.tar.gz yuzu-439e6216740f0ad01e88978147f02f70d182f498.tar.xz yuzu-439e6216740f0ad01e88978147f02f70d182f498.zip | |
Merge pull request #8372 from german77/touch
input_common: touch: Rewrite touch driver to support multiple touch points
Diffstat (limited to 'src/core/hid/input_converter.cpp')
| -rw-r--r-- | src/core/hid/input_converter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp index 3c26260f3..18d9f042d 100644 --- a/src/core/hid/input_converter.cpp +++ b/src/core/hid/input_converter.cpp | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <algorithm> | ||
| 4 | #include <random> | 5 | #include <random> |
| 5 | 6 | ||
| 6 | #include "common/input.h" | 7 | #include "common/input.h" |
| @@ -196,6 +197,9 @@ Common::Input::TouchStatus TransformToTouch(const Common::Input::CallbackStatus& | |||
| 196 | x = std::clamp(x, 0.0f, 1.0f); | 197 | x = std::clamp(x, 0.0f, 1.0f); |
| 197 | y = std::clamp(y, 0.0f, 1.0f); | 198 | y = std::clamp(y, 0.0f, 1.0f); |
| 198 | 199 | ||
| 200 | // Limit id to maximum number of fingers | ||
| 201 | status.id = std::clamp(status.id, 0, 16); | ||
| 202 | |||
| 199 | if (status.pressed.inverted) { | 203 | if (status.pressed.inverted) { |
| 200 | status.pressed.value = !status.pressed.value; | 204 | status.pressed.value = !status.pressed.value; |
| 201 | } | 205 | } |