MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / AddMouseWheelEvent

Method AddMouseWheelEvent

KBotExt/imgui/imgui.cpp:1556–1573  ·  view source on GitHub ↗

Queue a mouse wheel event (some mouse/API may only have a Y component)

Source from the content-addressed store, hash-verified

1554
1555// Queue a mouse wheel event (some mouse/API may only have a Y component)
1556void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y)
1557{
1558 IM_ASSERT(Ctx != NULL);
1559 ImGuiContext& g = *Ctx;
1560
1561 // Filter duplicate (unlike most events, wheel values are relative and easy to filter)
1562 if (!AppAcceptingEvents || (wheel_x == 0.0f && wheel_y == 0.0f))
1563 return;
1564
1565 ImGuiInputEvent e;
1566 e.Type = ImGuiInputEventType_MouseWheel;
1567 e.Source = ImGuiInputSource_Mouse;
1568 e.EventId = g.InputEventsNextEventId++;
1569 e.MouseWheel.WheelX = wheel_x;
1570 e.MouseWheel.WheelY = wheel_y;
1571 e.MouseWheel.MouseSource = g.InputEventsNextMouseSource;
1572 g.InputEventsQueue.push_back(e);
1573}
1574
1575// This is not a real event, the data is latched in order to be stored in actual Mouse events.
1576// This is so that duplicate events (e.g. Windows sending extraneous WM_MOUSEMOVE) gets filtered and are not leading to actual source changes.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected