Disable absolute mouse in Android app

This commit is contained in:
redphx 2024-12-08 06:50:08 +07:00
parent 4062852904
commit da362325f2
2 changed files with 20 additions and 3 deletions

View File

@ -4545,6 +4545,11 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
},
streamPageBeforeLoad(str) {
return PatcherUtils.patchBeforePageLoad(str, "stream");
},
disableAbsoluteMouse(str) {
let text = "sendAbsoluteMouseCapableMessage(e){";
if (!str.includes(text)) return !1;
return str = str.replace(text, text + "return;"), str;
}
}, PATCH_ORDERS = PatcherUtils.filterPatches([
...getPref("nativeMkb.mode") === "on" ? [
@ -4621,9 +4626,10 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
"patchRemotePlayMkb",
"remotePlayConnectMode"
] : [],
...getPref("nativeMkb.mode") === "on" ? [
...AppInterface && getPref("nativeMkb.mode") === "on" ? [
"patchMouseAndKeyboardEnabled",
"disableNativeRequestPointerLock"
"disableNativeRequestPointerLock",
"disableAbsoluteMouse"
] : []
]), PRODUCT_DETAIL_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([
AppInterface && "detectProductDetailPage"

View File

@ -947,6 +947,16 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
streamPageBeforeLoad(str: string) {
return PatcherUtils.patchBeforePageLoad(str, 'stream');
},
disableAbsoluteMouse(str: string) {
let text = 'sendAbsoluteMouseCapableMessage(e){';
if (!str.includes(text)) {
return false;
}
str = str.replace(text, text + 'return;');
return str;
}
};
let PATCH_ORDERS = PatcherUtils.filterPatches([
@ -1062,9 +1072,10 @@ let STREAM_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([
] : []),
// Native MKB
...(getPref<NativeMkbMode>(PrefKey.NATIVE_MKB_MODE) === NativeMkbMode.ON ? [
...(AppInterface && getPref<NativeMkbMode>(PrefKey.NATIVE_MKB_MODE) === NativeMkbMode.ON ? [
'patchMouseAndKeyboardEnabled',
'disableNativeRequestPointerLock',
'disableAbsoluteMouse',
] : []),
]);