diff options
author | omnisci3nce <omniscient.oce@gmail.com> | 2024-07-19 16:47:15 +1000 |
---|---|---|
committer | omnisci3nce <omniscient.oce@gmail.com> | 2024-07-19 16:47:15 +1000 |
commit | 0a984656f5fec68c90acc612b01f897918c0070b (patch) | |
tree | 59fffbcf00ac1507c7c1b281806ae5231c97ed4b /src/systems/input.h | |
parent | 3ccedcee719f5f1663a3be0210761495fab74856 (diff) |
handle right btn as well
Diffstat (limited to 'src/systems/input.h')
-rw-r--r-- | src/systems/input.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/systems/input.h b/src/systems/input.h index ce6e190..bf80a84 100644 --- a/src/systems/input.h +++ b/src/systems/input.h @@ -8,13 +8,19 @@ struct GLFWWindow; +typedef enum MouseBtn { + MOUSEBTN_LEFT = 0, + MOUSEBTN_RIGHT = 1, + MOUSEBTN_MIDDLE = 2, +} MouseBtn; + typedef struct mouse_state { i32 x; i32 y; i32 x_delta; i32 y_delta; - bool prev_left_btn_pressed; - bool left_btn_pressed; + bool prev_pressed_states[3]; + bool cur_pressed_states[3]; } mouse_state; typedef struct Input_State { @@ -35,7 +41,7 @@ bool key_just_pressed(keycode key); bool key_just_released(keycode key); // TODO: right btn as well -bool MouseBtn_Held(); +bool MouseBtn_Held(MouseBtn btn); // --- Lifecycle |