Stop ctrl scroll from chaging the page zoom

This commit is contained in:
2026-09-27 21:10:35 -03:00
parent c74ebcda4e
commit a6869eeb59
+6 -1
View File
@@ -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();