mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Add option to disable native MKB
This commit is contained in:
parent
22fc730fa1
commit
962b57f0a6
@ -55,6 +55,7 @@ const SETTINGS_UI = {
|
|||||||
|
|
||||||
[t('mouse-and-keyboard')]: {
|
[t('mouse-and-keyboard')]: {
|
||||||
items: [
|
items: [
|
||||||
|
PrefKey.NATIVE_MKB_DISABLED,
|
||||||
PrefKey.MKB_ENABLED,
|
PrefKey.MKB_ENABLED,
|
||||||
PrefKey.MKB_HIDE_IDLE_CURSOR,
|
PrefKey.MKB_HIDE_IDLE_CURSOR,
|
||||||
],
|
],
|
||||||
|
@ -38,6 +38,12 @@ export const BxExposed = {
|
|||||||
titleInfo = structuredClone(titleInfo);
|
titleInfo = structuredClone(titleInfo);
|
||||||
|
|
||||||
let supportedInputTypes = titleInfo.details.supportedInputTypes;
|
let supportedInputTypes = titleInfo.details.supportedInputTypes;
|
||||||
|
|
||||||
|
// Remove native MKB support on mobile browsers or by user's choice
|
||||||
|
if (getPref(PrefKey.NATIVE_MKB_DISABLED) || UserAgent.isMobile()) {
|
||||||
|
supportedInputTypes = supportedInputTypes.filter(i => i !== InputType.MKB);
|
||||||
|
}
|
||||||
|
|
||||||
titleInfo.details.hasMkbSupport = supportedInputTypes.includes(InputType.MKB);
|
titleInfo.details.hasMkbSupport = supportedInputTypes.includes(InputType.MKB);
|
||||||
|
|
||||||
if (STATES.hasTouchSupport) {
|
if (STATES.hasTouchSupport) {
|
||||||
@ -58,10 +64,7 @@ export const BxExposed = {
|
|||||||
gamepadFound && (touchControllerAvailability = 'off');
|
gamepadFound && (touchControllerAvailability = 'off');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove MKB support on mobile browsers
|
|
||||||
if (UserAgent.isMobile()) {
|
|
||||||
supportedInputTypes = supportedInputTypes.filter(i => i !== InputType.MKB);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (touchControllerAvailability === 'off') {
|
if (touchControllerAvailability === 'off') {
|
||||||
// Disable touch on all games (not native touch)
|
// Disable touch on all games (not native touch)
|
||||||
@ -78,10 +81,10 @@ export const BxExposed = {
|
|||||||
titleInfo.details.hasFakeTouchSupport = true;
|
titleInfo.details.hasFakeTouchSupport = true;
|
||||||
supportedInputTypes.push(InputType.GENERIC_TOUCH);
|
supportedInputTypes.push(InputType.GENERIC_TOUCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
titleInfo.details.supportedInputTypes = supportedInputTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
titleInfo.details.supportedInputTypes = supportedInputTypes;
|
||||||
|
|
||||||
// Save this info in STATES
|
// Save this info in STATES
|
||||||
STATES.currentStream.titleInfo = titleInfo;
|
STATES.currentStream.titleInfo = titleInfo;
|
||||||
BxEvent.dispatch(window, BxEvent.TITLE_INFO_READY);
|
BxEvent.dispatch(window, BxEvent.TITLE_INFO_READY);
|
||||||
|
@ -44,6 +44,7 @@ export enum PrefKey {
|
|||||||
CONTROLLER_DEVICE_VIBRATION = 'controller_device_vibration',
|
CONTROLLER_DEVICE_VIBRATION = 'controller_device_vibration',
|
||||||
CONTROLLER_VIBRATION_INTENSITY = 'controller_vibration_intensity',
|
CONTROLLER_VIBRATION_INTENSITY = 'controller_vibration_intensity',
|
||||||
|
|
||||||
|
NATIVE_MKB_DISABLED = 'native_mkb_disabled',
|
||||||
MKB_ENABLED = 'mkb_enabled',
|
MKB_ENABLED = 'mkb_enabled',
|
||||||
MKB_HIDE_IDLE_CURSOR = 'mkb_hide_idle_cursor',
|
MKB_HIDE_IDLE_CURSOR = 'mkb_hide_idle_cursor',
|
||||||
MKB_ABSOLUTE_MOUSE = 'mkb_absolute_mouse',
|
MKB_ABSOLUTE_MOUSE = 'mkb_absolute_mouse',
|
||||||
@ -419,6 +420,11 @@ export class Preferences {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
[PrefKey.NATIVE_MKB_DISABLED]: {
|
||||||
|
label: t('disable-native-mkb'),
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
|
||||||
[PrefKey.MKB_DEFAULT_PRESET_ID]: {
|
[PrefKey.MKB_DEFAULT_PRESET_ID]: {
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user