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

@@ -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',
] : []),
]);