MouseState.ScrollWheelValue not working? #2249
|
Hi, is it possible to that the mouse wheel events are not captured in Blazor? Or am I doing something wrong? This works fine in DesktopGL for zooming in and out, but does nothing in Blazor. var scrollWheelDelta = mouseState.ScrollWheelValue - _lastMouseState.ScrollWheelValue;
if (scrollWheelDelta != 0)
{
_camera.Zoom *= (float)Math.Pow(1.2d, scrollWheelDelta / 120.0d);
}Thanks! |
Answered by
Tokter
Mar 13, 2025
Replies: 1 comment
|
I found the issue, this code in index.html swallows the wheel events window.addEventListener("wheel", function(event)
{
// Prevent Mousewheel scrolling the outer page
// when running inside an iframe. e.g: itch.io embedding.
event.preventDefault();
}, { passive: false }); |
0 replies
Answer selected by
Tokter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found the issue, this code in index.html swallows the wheel events