| 1516 | #endif |
| 1517 | |
| 1518 | static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1) |
| 1519 | { |
| 1520 | ImGuiContext& g = *ctx; |
| 1521 | for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--) |
| 1522 | { |
| 1523 | ImGuiInputEvent* e = &g.InputEventsQueue[n]; |
| 1524 | if (e->Type != type) |
| 1525 | continue; |
| 1526 | if (type == ImGuiInputEventType_Key && e->Key.Key != arg) |
| 1527 | continue; |
| 1528 | if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg) |
| 1529 | continue; |
| 1530 | return e; |
| 1531 | } |
| 1532 | return NULL; |
| 1533 | } |
| 1534 | |
| 1535 | // Queue a new key down/up event. |
| 1536 | // - 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