Files
sml-projects/ffi/glfw-key-input.c
2024-07-28 14:22:17 +01:00

15 lines
385 B
C

#include "export.h"
#include <GLFW/glfw3.h>
#include <stdbool.h>
// Calls function exported from SML
void keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) {
printFromMLton(key, scancode, action, mods);
}
// Call this from MLton to register key callback with GLFW.
void setKeyCallback(GLFWwindow *window) {
glfwSetKeyCallback(window, keyCallback);
}