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

Function FindLatestInputEvent

tutorials/common/imgui/imgui.cpp:1317–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1315}
1316
1317static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = -1)
1318{
1319 ImGuiContext& g = *GImGui;
1320 for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--)
1321 {
1322 ImGuiInputEvent* e = &g.InputEventsQueue[n];
1323 if (e->Type != type)
1324 continue;
1325 if (type == ImGuiInputEventType_Key && e->Key.Key != arg)
1326 continue;
1327 if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg)
1328 continue;
1329 return e;
1330 }
1331 return NULL;
1332}
1333
1334// Queue a new key down/up event.
1335// - ImGuiKey key: Translated key (as in, generally ImGuiKey_A matches the key end-user would use to emit an 'A' character)

Callers 4

AddKeyAnalogEventMethod · 0.85
AddMousePosEventMethod · 0.85
AddMouseButtonEventMethod · 0.85
AddFocusEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected