| 1355 | } |
| 1356 | |
| 1357 | static 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) |
no outgoing calls
no test coverage detected