From c0842c78cb462275177b57394fb7444ba8f4ab2e Mon Sep 17 00:00:00 2001 From: slowriot Date: Thu, 2 Apr 2026 22:39:51 +0100 Subject: [PATCH] consume mousewheel event if imgui wants to capture the mouse Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- backends/imgui_impl_emscripten.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backends/imgui_impl_emscripten.cpp b/backends/imgui_impl_emscripten.cpp index f651f1299..ce490569b 100644 --- a/backends/imgui_impl_emscripten.cpp +++ b/backends/imgui_impl_emscripten.cpp @@ -228,11 +228,12 @@ void ImGui_ImplEmscripten_Init() break; } // TODO: make scrolling speeds configurable - ImGui::GetIO().AddMouseWheelEvent( + ImGuiIO& io{ImGui::GetIO()}; + io.AddMouseWheelEvent( -static_cast(wheel_event->deltaX) * scale, -static_cast(wheel_event->deltaY) * scale ); - return false; // the event was not consumed + return io.WantCaptureMouse; // consume the event when imgui wants to capture mouse input } ); emscripten_set_keydown_callback(