From a6869eeb59b472f4a1dec9c87a68b978d9983429 Mon Sep 17 00:00:00 2001 From: Paula Date: Sun, 27 Sep 2026 21:10:35 -0300 Subject: [PATCH] Stop ctrl scroll from chaging the page zoom --- client/input_manager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/input_manager.ts b/client/input_manager.ts index dd6b440..fc664fd 100644 --- a/client/input_manager.ts +++ b/client/input_manager.ts @@ -171,9 +171,14 @@ export class InputManager { this.mouse_buttons_released.add(e.button); }); + // ctrl+scroll (and pinching a trackpad, which browsers send as that) would zoom the page. only a listener that + // isn't passive can stop it, and on the window they're passive unless told otherwise self.addEventListener("wheel", (e) => { + if (e.ctrlKey) { + e.preventDefault(); + } this.wheel_delta += e.deltaY; - }); + }, { passive: false }); document.addEventListener("mousemove", (e) => { e.preventDefault();