mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-09 16:05:56 +01:00
consume mousewheel event if imgui wants to capture the mouse
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
8fa2322760
commit
c0842c78cb
@ -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<float>(wheel_event->deltaX) * scale,
|
||||
-static_cast<float>(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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user