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

Function FindLatestInputEvent

KBotExt/imgui/imgui.cpp:1402–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1400#endif
1401
1402static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1)
1403{
1404 ImGuiContext& g = *ctx;
1405 for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--)
1406 {
1407 ImGuiInputEvent* e = &g.InputEventsQueue[n];
1408 if (e->Type != type)
1409 continue;
1410 if (type == ImGuiInputEventType_Key && e->Key.Key != arg)
1411 continue;
1412 if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg)
1413 continue;
1414 return e;
1415 }
1416 return NULL;
1417}
1418
1419// Queue a new key down/up event.
1420// - 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