MCPcopy Create free account
hub / github.com/ShenCiao/CialloResearch / AddMouseButtonEvent

Method AddMouseButtonEvent

imgui/imgui.cpp:1485–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1483}
1484
1485void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down)
1486{
1487 ImGuiContext& g = *GImGui;
1488 IM_ASSERT(&g.IO == this && "Can only add events to current context.");
1489 IM_ASSERT(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT);
1490 if (!AppAcceptingEvents)
1491 return;
1492
1493 // Filter duplicate
1494 const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MouseButton, (int)mouse_button);
1495 const bool latest_button_down = latest_event ? latest_event->MouseButton.Down : g.IO.MouseDown[mouse_button];
1496 if (latest_button_down == down)
1497 return;
1498
1499 ImGuiInputEvent e;
1500 e.Type = ImGuiInputEventType_MouseButton;
1501 e.Source = ImGuiInputSource_Mouse;
1502 e.MouseButton.Button = mouse_button;
1503 e.MouseButton.Down = down;
1504 g.InputEventsQueue.push_back(e);
1505}
1506
1507// Queue a mouse wheel event (most mouse/API will only have a Y component)
1508void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y)

Callers 1

Calls 2

FindLatestInputEventFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected