From b5926bcce6269bd207727aeec4608d197b655d90 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 27 Apr 2026 19:29:22 +0200 Subject: [PATCH] Add event listeners for pointer lock escape key handling --- src/runtime-three/runtime-host.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index c8817a72..435b1e68 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -1054,6 +1054,11 @@ export class RuntimeHost { this.domElement.addEventListener("wheel", this.handleRuntimeWheel, { passive: false }); + window.addEventListener( + "keydown", + this.handlePointerLockEscapeKeyDown, + true + ); window.addEventListener("keydown", this.handleRuntimeKeyDown); window.addEventListener("keyup", this.handleRuntimeKeyUp); window.addEventListener("pointermove", this.handleRuntimePointerMove); @@ -1383,6 +1388,11 @@ export class RuntimeHost { this.handleRuntimePointerDown ); this.domElement.removeEventListener("wheel", this.handleRuntimeWheel); + window.removeEventListener( + "keydown", + this.handlePointerLockEscapeKeyDown, + true + ); window.removeEventListener("keydown", this.handleRuntimeKeyDown); window.removeEventListener("keyup", this.handleRuntimeKeyUp); window.removeEventListener("pointermove", this.handleRuntimePointerMove);