From 6421243d6858011f4477f641b01ce29af5ece604 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:29:58 +0700 Subject: [PATCH] Fix touch controller not working on non-touch supported games --- src/modules/patcher.ts | 2 +- src/types/index.d.ts | 1 + src/utils/bx-exposed.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index 7e63df5..d524625 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -325,7 +325,7 @@ if (match) { const newCode = ` const titleInfo = window.BX_EXPOSED.getTitleInfo(); -if (!titleInfo.details.hasTouchSupport) { +if (!titleInfo.details.hasTouchSupport && !titleInfo.details.hasFakeTouchSupport) { return; } `; diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 98cbc9f..79fc6e5 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -57,6 +57,7 @@ type XcloudTitleInfo = { productId: string; supportedInputTypes: InputType[]; hasTouchSupport: boolean; + hasFakeTouchSupport: boolean; hasMkbSupport: boolean; }; diff --git a/src/utils/bx-exposed.ts b/src/utils/bx-exposed.ts index 1b0e02d..7b6e2d1 100644 --- a/src/utils/bx-exposed.ts +++ b/src/utils/bx-exposed.ts @@ -79,6 +79,7 @@ export const BxExposed = { if (!titleInfo.details.hasTouchSupport && touchControllerAvailability === 'all') { // Add generic touch support for non touch-supported games + titleInfo.details.hasFakeTouchSupport = true; supportedInputTypes.push(InputType.GENERIC_TOUCH); }