Enabled pointer lock to capture the pointer when the canvas is clicked

This commit is contained in:
Michael Green 2024-03-02 00:06:22 +11:00
parent ae0ea3cc99
commit e4f7b2a9be

View file

@ -1904,7 +1904,7 @@ class EmulatorJS {
}) })
this.addEventListener(this.canvas, "click", (e) => { this.addEventListener(this.canvas, "click", (e) => {
if (e.pointerType === "touch") return; if (e.pointerType === "touch") return;
if (this.getCore(true) === "nds" && !this.paused) { if (!this.paused) {
if (this.canvas.requestPointerLock) { if (this.canvas.requestPointerLock) {
this.canvas.requestPointerLock(); this.canvas.requestPointerLock();
} else if (this.canvas.mozRequestPointerLock) { } else if (this.canvas.mozRequestPointerLock) {