MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / FindLatestInputEvent

Function FindLatestInputEvent

extern/imgui/imgui.cpp:1357–1372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1355}
1356
1357static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = -1)
1358{
1359 ImGuiContext& g = *GImGui;
1360 for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--)
1361 {
1362 ImGuiInputEvent* e = &g.InputEventsQueue[n];
1363 if (e->Type != type)
1364 continue;
1365 if (type == ImGuiInputEventType_Key && e->Key.Key != arg)
1366 continue;
1367 if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg)
1368 continue;
1369 return e;
1370 }
1371 return NULL;
1372}
1373
1374// Queue a new key down/up event.
1375// - ImGuiKey key: Translated key (as in, generally ImGuiKey_A matches the key end-user would use to emit an 'A' character)

Callers 5

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

Calls

no outgoing calls

Tested by

no test coverage detected