added mouse wheel support

This commit is contained in:
2026-01-12 21:54:15 +05:00
parent 75d894b1bd
commit 717c049265
8 changed files with 141 additions and 37 deletions

View File

@@ -129,6 +129,8 @@ typedef enum TimEventType {
enum {
TimKey_MouseButtonLeft = 1,
TimKey_MouseScrollUp = 4,
TimKey_MouseScrollDown = 5,
TimKey_Backspace = 8,
TimKey_Tab = 9,
TimKey_Enter = 13,
@@ -307,7 +309,11 @@ void TimEditState_delete(TimEditState* e);
bool tim_is_event_key(TimEventType type, TimKey key);
// returns true if event was press of key
bool tim_is_key_press(TimKey key);
static inline bool tim_is_key_press(TimKey key) { return tim_is_event_key(TimEvent_Key, key); }
static inline bool tim_is_mouse_scroll_up() { return tim_is_event_key(TimEvent_Mouse, TimKey_MouseScrollUp); }
static inline bool tim_is_mouse_scroll_down() { return tim_is_event_key(TimEvent_Mouse, TimKey_MouseScrollDown); }
// returns true if mouse event was over r
bool tim_is_mouse_over(TimRect r);