From 62d296992e68b8a823b6d8a32e8a2760f6227edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 10 Apr 2019 21:13:55 +0200 Subject: [PATCH] Add min/max corner placement to cursor test Related to #1461. --- tests/cursor.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/cursor.c b/tests/cursor.c index a72c14e3..c5ca0a0c 100644 --- a/tests/cursor.c +++ b/tests/cursor.c @@ -251,6 +251,20 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, break; } + case GLFW_KEY_UP: + glfwSetCursorPos(window, 0, 0); + glfwGetCursorPos(window, &cursor_x, &cursor_y); + break; + + case GLFW_KEY_DOWN: + { + int width, height; + glfwGetWindowSize(window, &width, &height); + glfwSetCursorPos(window, width - 1, height - 1); + glfwGetCursorPos(window, &cursor_x, &cursor_y); + break; + } + case GLFW_KEY_0: glfwSetCursor(window, NULL); break;