Stop ctrl scroll from chaging the page zoom
This commit is contained in:
@@ -171,9 +171,14 @@ export class InputManager {
|
|||||||
this.mouse_buttons_released.add(e.button);
|
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) => {
|
self.addEventListener("wheel", (e) => {
|
||||||
|
if (e.ctrlKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
this.wheel_delta += e.deltaY;
|
this.wheel_delta += e.deltaY;
|
||||||
});
|
}, { passive: false });
|
||||||
|
|
||||||
document.addEventListener("mousemove", (e) => {
|
document.addEventListener("mousemove", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user