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 | c82806f9cb88f390ae3fb048ba7ff2bb138fa3ec (patch) | |
| tree | 60f52dfd3e59f1424d03ab71a8cb28b9b845d486 /src/core/hid/input_converter.cpp | |
| parent | 4eb7f6c04473e3f90e2622ee00b822febe1ccef9 (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 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; } |
