diff --git a/shader.mjs b/shader.mjs index ca398e2..8fd4d86 100644 --- a/shader.mjs +++ b/shader.mjs @@ -170,5 +170,10 @@ document.addEventListener("keydown", function (event) { document.addEventListener("keyup", function (event) { keymap.set(event.key, false); }); +// Request pointer Lock +canvas.addEventListener("click", async () => { + await canvas.requestPointerLock(); +}); + // Update loop draw(gl, program);