diff options
| author | german77 <juangerman-13@hotmail.com> | 2022-05-22 20:34:32 -0500 |
|---|---|---|
| committer | Narr the Reg <juangerman-13@hotmail.com> | 2022-05-23 11:01:14 -0500 |
| commit | b6d3a7d8cf99655cd90dff6f01517edc870ca1ce (patch) | |
| tree | 60f52dfd3e59f1424d03ab71a8cb28b9b845d486 /src/core/hid/input_converter.cpp | |
| parent | 6c08d6ce1c1c827b9e8db47c0ec18e5de887ceb9 (diff) | |
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 3c26260f37..18d9f042da 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; } |
