From 7b2352c225865e8c62f2241457a62040643e7533 Mon Sep 17 00:00:00 2001 From: vlev Date: Thu, 2 May 2024 22:57:10 -0400 Subject: [PATCH] event callbacks docs --- src/lu5_event_callbacks.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/lu5_event_callbacks.c b/src/lu5_event_callbacks.c index ba813ded..2e255f6d 100644 --- a/src/lu5_event_callbacks.c +++ b/src/lu5_event_callbacks.c @@ -5,9 +5,22 @@ #include +/** + * @brief mousePressed + * + * Called when a mouse button is pressed. + * The mouse button is passed as the first argument + */ + +/** + * @brief mouseReleased + * + * Called when a mouse button is released. + * The mouse button is passed as the first argument + */ + static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) { - if (!lu5.L) return; lu5.input.mouse.actions[button] = action; @@ -27,6 +40,29 @@ static void mouse_button_callback(GLFWwindow* window, int button, int action, in } } + +/** + * @brief keyPressed + * + * Called whenever a key is pressed. + * Key is passed as the first argument. + */ + +/** + * @brief keyReleased + * + * Called whenever a key is released. + * Key is passed as the first argument. + */ + +/** + * @brief keyHeld + * + * Called whenever a key is held down. + * Key is passed as the first argument. + */ + + static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) { if (!lu5.L) return;