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

Method AddMouseButtonEvent

tutorials/common/imgui/imgui.cpp:1440–1460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1438}
1439
1440void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down)
1441{
1442 ImGuiContext& g = *GImGui;
1443 IM_ASSERT(&g.IO == this && "Can only add events to current context.");
1444 IM_ASSERT(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT);
1445 if (!AppAcceptingEvents)
1446 return;
1447
1448 // Filter duplicate
1449 const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MouseButton, (int)mouse_button);
1450 const bool latest_button_down = latest_event ? latest_event->MouseButton.Down : g.IO.MouseDown[mouse_button];
1451 if (latest_button_down == down)
1452 return;
1453
1454 ImGuiInputEvent e;
1455 e.Type = ImGuiInputEventType_MouseButton;
1456 e.Source = ImGuiInputSource_Mouse;
1457 e.MouseButton.Button = mouse_button;
1458 e.MouseButton.Down = down;
1459 g.InputEventsQueue.push_back(e);
1460}
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)

Callers 1

Calls 2

FindLatestInputEventFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected