MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / FindLatestInputEvent

Function FindLatestInputEvent

TheForceEngine/TFE_Ui/imGUI/imgui.cpp:1518–1533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1516#endif
1517
1518static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1)
1519{
1520 ImGuiContext& g = *ctx;
1521 for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--)
1522 {
1523 ImGuiInputEvent* e = &g.InputEventsQueue[n];
1524 if (e->Type != type)
1525 continue;
1526 if (type == ImGuiInputEventType_Key && e->Key.Key != arg)
1527 continue;
1528 if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg)
1529 continue;
1530 return e;
1531 }
1532 return NULL;
1533}
1534
1535// Queue a new key down/up event.
1536// - 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