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