Attempt to fix problem with unadjustedMovement (#628)

This commit is contained in:
redphx
2024-12-31 06:52:50 +07:00
parent 40d1878fb2
commit e109cdec6a
3 changed files with 16 additions and 9 deletions

View File

@@ -3445,9 +3445,11 @@ class EmulatedMkbHandler extends MkbHandler {
if (!this.initialized) return;
if (typeof force !== "undefined") this.enabled = force;
else this.enabled = !this.enabled;
if (this.enabled) document.body.requestPointerLock({
unadjustedMovement: !0
});
if (this.enabled) try {
document.body.requestPointerLock({ unadjustedMovement: !0 });
} catch (e) {
document.body.requestPointerLock(), console.log(e);
}
else document.pointerLockElement && document.exitPointerLock();
}
refreshPresetData() {