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

Function FindLatestInputEvent

src-core/imgui/imgui.cpp:1421–1436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1419#endif
1420
1421static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1)
1422{
1423 ImGuiContext& g = *ctx;
1424 for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--)
1425 {
1426 ImGuiInputEvent* e = &g.InputEventsQueue[n];
1427 if (e->Type != type)
1428 continue;
1429 if (type == ImGuiInputEventType_Key && e->Key.Key != arg)
1430 continue;
1431 if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg)
1432 continue;
1433 return e;
1434 }
1435 return NULL;
1436}
1437
1438// Queue a new key down/up event.
1439// - 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