From 1aa33128e902e6ef7ef02ea706c840579a41f399 Mon Sep 17 00:00:00 2001 From: Timerix Date: Mon, 12 Jan 2026 15:51:07 +0500 Subject: [PATCH] tim_event_consume() --- include/tim.h | 4 ++++ src/edit.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/tim.h b/include/tim.h index 299e684..afd7587 100644 --- a/include/tim.h +++ b/include/tim.h @@ -310,6 +310,10 @@ bool tim_is_mouse_over(TimRect r); // returns true if event is mouse left-down and over r bool tim_is_mouse_click_over(TimRect r); +static inline void tim_event_consume(){ + tim->event.type = TimEvent_Void; +} + #pragma endregion diff --git a/src/edit.c b/src/edit.c index 4212fe1..555ec35 100755 --- a/src/edit.c +++ b/src/edit.c @@ -47,7 +47,8 @@ static TimKey edit_event(TimEditState* e, TimRect r) { // not focused or no key press return 0; } - tim->event.type = TimEvent_Void; // consume event + + tim_event_consume(); switch (tim->event.key) { case TimKey_Escape: