MCPcopy Create free account
hub / github.com/RenderKit/embree / AddMouseWheelEvent

Method AddMouseWheelEvent

tutorials/common/imgui/imgui.cpp:1463–1478  ·  view source on GitHub ↗

Queue a mouse wheel event (most mouse/API will only have a Y component)

Source from the content-addressed store, hash-verified

1461
1462// Queue a mouse wheel event (most mouse/API will only have a Y component)
1463void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y)
1464{
1465 ImGuiContext& g = *GImGui;
1466 IM_ASSERT(&g.IO == this && "Can only add events to current context.");
1467
1468 // Filter duplicate (unlike most events, wheel values are relative and easy to filter)
1469 if (!AppAcceptingEvents || (wheel_x == 0.0f && wheel_y == 0.0f))
1470 return;
1471
1472 ImGuiInputEvent e;
1473 e.Type = ImGuiInputEventType_MouseWheel;
1474 e.Source = ImGuiInputSource_Mouse;
1475 e.MouseWheel.WheelX = wheel_x;
1476 e.MouseWheel.WheelY = wheel_y;
1477 g.InputEventsQueue.push_back(e);
1478}
1479
1480void ImGuiIO::AddFocusEvent(bool focused)
1481{

Callers 1

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected