]> git.lizzy.rs Git - shadowclad.git/blobdiff - src/engine/input.c
Restructure keyboard input handling
[shadowclad.git] / src / engine / input.c
diff --git a/src/engine/input.c b/src/engine/input.c
new file mode 100644 (file)
index 0000000..01d3c41
--- /dev/null
@@ -0,0 +1,19 @@
+#include "input.h"
+
+#include <stdbool.h>
+
+static void (*keyboardInputCallback) (int, int, int, int);
+
+
+
+void onKeyboardEvent(GLFWwindow* window, int key, int scancode, int action, int mods) {
+       bool handled = false;
+
+       if (!handled && keyboardInputCallback) {
+               keyboardInputCallback(key, scancode, action, mods);
+       }
+}
+
+void setKeyboardInputCallback(void (*callback) (int, int, int, int)) {
+       keyboardInputCallback = callback;
+}