| 1814 | } |
| 1815 | |
| 1816 | static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1) |
| 1817 | { |
| 1818 | ImGuiContext& g = *ctx; |
| 1819 | for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--) |
| 1820 | { |
| 1821 | ImGuiInputEvent* e = &g.InputEventsQueue[n]; |
| 1822 | if (e->Type != type) |
| 1823 | continue; |
| 1824 | if (type == ImGuiInputEventType_Key && e->Key.Key != arg) |
| 1825 | continue; |
| 1826 | if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg) |
| 1827 | continue; |
| 1828 | return e; |
| 1829 | } |
| 1830 | return NULL; |
| 1831 | } |
| 1832 | |
| 1833 | // Queue a new key down/up event. |
| 1834 | // - 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