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

@@ -440,9 +440,12 @@ export class EmulatedMkbHandler extends MkbHandler {
}
if (this.enabled) {
document.body.requestPointerLock({
unadjustedMovement: true,
});
try {
document.body.requestPointerLock({ unadjustedMovement: true });
} catch (e) {
document.body.requestPointerLock();
console.log(e);
}
} else {
document.pointerLockElement && document.exitPointerLock();
}