summaryrefslogtreecommitdiff
path: root/src/core/hid/input_converter.cpp
diff options
context:
space:
mode:
authorGravatar german772022-05-22 20:34:32 -0500
committerGravatar Narr the Reg2022-05-23 11:01:14 -0500
commitc82806f9cb88f390ae3fb048ba7ff2bb138fa3ec (patch)
tree60f52dfd3e59f1424d03ab71a8cb28b9b845d486 /src/core/hid/input_converter.cpp
parentMerge pull request #8342 from lat9nq/clang-latest-stdc++ (diff)
downloadyuzu-c82806f9cb88f390ae3fb048ba7ff2bb138fa3ec.tar.gz
yuzu-c82806f9cb88f390ae3fb048ba7ff2bb138fa3ec.tar.xz
yuzu-c82806f9cb88f390ae3fb048ba7ff2bb138fa3ec.zip
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.cpp4
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 }