From c82806f9cb88f390ae3fb048ba7ff2bb138fa3ec Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 22 May 2022 20:34:32 -0500 Subject: input_common: touch: Rewrite touch driver to support multiple touch points --- src/core/hid/input_converter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/hid/input_converter.cpp') 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 #include #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; } -- cgit v1.2.3