mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Don't emulate MKB in native MKB supported games
This commit is contained in:
parent
cd6dd1e22d
commit
99aec0a60c
@ -9,6 +9,8 @@ import { LocalDb } from "../../utils/local-db";
|
|||||||
import { KeyHelper } from "./key-helper";
|
import { KeyHelper } from "./key-helper";
|
||||||
import type { MkbStoredPreset } from "../../types/mkb";
|
import type { MkbStoredPreset } from "../../types/mkb";
|
||||||
import { showStreamSettings } from "../stream/stream-ui";
|
import { showStreamSettings } from "../stream/stream-ui";
|
||||||
|
import { STATES } from "../../utils/global";
|
||||||
|
import { UserAgent } from "../../utils/user-agent";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This class uses some code from Yuzu emulator to handle mouse's movements
|
This class uses some code from Yuzu emulator to handle mouse's movements
|
||||||
@ -457,9 +459,9 @@ export class MkbHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static setupEvents() {
|
static setupEvents() {
|
||||||
window.addEventListener(BxEvent.STREAM_PLAYING, () => {
|
getPref(PrefKey.MKB_ENABLED) && !UserAgent.isMobile() && window.addEventListener(BxEvent.STREAM_PLAYING, () => {
|
||||||
// Enable MKB
|
// Enable MKB
|
||||||
if (getPref(PrefKey.MKB_ENABLED)) {
|
if (!STATES.currentStream.titleInfo?.details.hasMkbSupport) {
|
||||||
console.log('Emulate MKB');
|
console.log('Emulate MKB');
|
||||||
MkbHandler.INSTANCE.init();
|
MkbHandler.INSTANCE.init();
|
||||||
}
|
}
|
||||||
|
1
src/types/index.d.ts
vendored
1
src/types/index.d.ts
vendored
@ -57,6 +57,7 @@ type XcloudTitleInfo = {
|
|||||||
productId: string;
|
productId: string;
|
||||||
supportedInputTypes: InputType[];
|
supportedInputTypes: InputType[];
|
||||||
hasTouchSupport: boolean;
|
hasTouchSupport: boolean;
|
||||||
|
hasMkbSupport: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
product: {
|
product: {
|
||||||
|
@ -49,7 +49,8 @@ export const BxExposed = {
|
|||||||
supportedInputTypes = supportedInputTypes.filter(i => i !== 'MKB');
|
supportedInputTypes = supportedInputTypes.filter(i => i !== 'MKB');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add custom property
|
// Pre-check supported input types
|
||||||
|
titleInfo.details.hasMkbSupport = supportedInputTypes.includes(InputType.MKB);
|
||||||
titleInfo.details.hasTouchSupport = supportedInputTypes.includes(InputType.NATIVE_TOUCH) &&
|
titleInfo.details.hasTouchSupport = supportedInputTypes.includes(InputType.NATIVE_TOUCH) &&
|
||||||
!supportedInputTypes.includes(InputType.CUSTOM_TOUCH_OVERLAY) &&
|
!supportedInputTypes.includes(InputType.CUSTOM_TOUCH_OVERLAY) &&
|
||||||
!supportedInputTypes.includes(InputType.GENERIC_TOUCH);
|
!supportedInputTypes.includes(InputType.GENERIC_TOUCH);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user