diff options
| author | bunnei <bunneidev@gmail.com> | 2022-05-27 12:16:03 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-27 12:16:03 -0700 |
| commit | 439e6216740f0ad01e88978147f02f70d182f498 (patch) | |
| tree | 3873d1660b42dcb17fdacd01990500055495d3ae /src/core/hid/input_converter.cpp | |
| parent | b01541f4e4b36b5477280473454fb648443c68b2 (diff) | |
| parent | c82806f9cb88f390ae3fb048ba7ff2bb138fa3ec (diff) | |
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 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include <algorithm> #include <random> #include "common/input.h" @@ -196,6 +197,9 @@ Common::Input::TouchStatus TransformToTouch(const Common::Input::CallbackStatus& x = std::clamp(x, 0.0f, 1.0f); y = std::clamp(y, 0.0f, 1.0f); + // Limit id to maximum number of fingers + status.id = std::clamp(status.id, 0, 16); + if (status.pressed.inverted) { status.pressed.value = !status.pressed.value; } |
