| 1315 | } |
| 1316 | |
| 1317 | static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = -1) |
| 1318 | { |
| 1319 | ImGuiContext& g = *GImGui; |
| 1320 | for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--) |
| 1321 | { |
| 1322 | ImGuiInputEvent* e = &g.InputEventsQueue[n]; |
| 1323 | if (e->Type != type) |
| 1324 | continue; |
| 1325 | if (type == ImGuiInputEventType_Key && e->Key.Key != arg) |
| 1326 | continue; |
| 1327 | if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg) |
| 1328 | continue; |
| 1329 | return e; |
| 1330 | } |
| 1331 | return NULL; |
| 1332 | } |
| 1333 | |
| 1334 | // Queue a new key down/up event. |
| 1335 | // - 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