Fix touch controller not working on non-touch supported games

This commit is contained in:
redphx 2024-04-29 15:29:58 +07:00
parent f615471120
commit 6421243d68
3 changed files with 3 additions and 1 deletions

View File

@ -325,7 +325,7 @@ if (match) {
const newCode = ` const newCode = `
const titleInfo = window.BX_EXPOSED.getTitleInfo(); const titleInfo = window.BX_EXPOSED.getTitleInfo();
if (!titleInfo.details.hasTouchSupport) { if (!titleInfo.details.hasTouchSupport && !titleInfo.details.hasFakeTouchSupport) {
return; return;
} }
`; `;

View File

@ -57,6 +57,7 @@ type XcloudTitleInfo = {
productId: string; productId: string;
supportedInputTypes: InputType[]; supportedInputTypes: InputType[];
hasTouchSupport: boolean; hasTouchSupport: boolean;
hasFakeTouchSupport: boolean;
hasMkbSupport: boolean; hasMkbSupport: boolean;
}; };

View File

@ -79,6 +79,7 @@ export const BxExposed = {
if (!titleInfo.details.hasTouchSupport && touchControllerAvailability === 'all') { if (!titleInfo.details.hasTouchSupport && touchControllerAvailability === 'all') {
// Add generic touch support for non touch-supported games // Add generic touch support for non touch-supported games
titleInfo.details.hasFakeTouchSupport = true;
supportedInputTypes.push(InputType.GENERIC_TOUCH); supportedInputTypes.push(InputType.GENERIC_TOUCH);
} }