diff --git a/tests/events.c b/tests/events.c index fffd9f58..e43c52ea 100644 --- a/tests/events.c +++ b/tests/events.c @@ -42,6 +42,7 @@ static GLboolean keyrepeat = 0; static GLboolean systemkeys = 1; +static GLboolean closeable = 1; static unsigned int counter = 0; static const char* get_key_name(int key) @@ -230,7 +231,7 @@ static void window_size_callback(GLFWwindow window, int width, int height) static int window_close_callback(GLFWwindow window) { printf("%08x at %0.3f: Window close\n", counter++, glfwGetTime()); - return 1; + return closeable; } static void window_refresh_callback(GLFWwindow window) @@ -312,6 +313,14 @@ static void key_callback(GLFWwindow window, int key, int action) printf("(( system keys %s ))\n", systemkeys ? "enabled" : "disabled"); break; } + + case GLFW_KEY_C: + { + closeable = !closeable; + + printf("(( closing %s ))\n", closeable ? "enabled" : "disabled"); + break; + } } }