mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
committed by
Camilla Löwy
parent
5f4e66b21a
commit
62d296992e
@@ -251,6 +251,20 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
break;
|
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:
|
case GLFW_KEY_0:
|
||||||
glfwSetCursor(window, NULL);
|
glfwSetCursor(window, NULL);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user