diff --git a/shell/windows/opengl/App.cpp b/shell/windows/opengl/App.cpp index 3948c1d6df..31f8d0da69 100644 --- a/shell/windows/opengl/App.cpp +++ b/shell/windows/opengl/App.cpp @@ -186,6 +186,9 @@ GLFWwindow* initGLWindow(const shell::RenderSessionConfig& config) { glfwSetKeyCallback(windowHandle, [](GLFWwindow* window, int key, int scancode, int action, int mods) { + if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { + glfwSetWindowShouldClose(window, GLFW_TRUE); + } if (key == GLFW_KEY_SPACE && action == GLFW_RELEASE) { angleBackend = !angleBackend; IGL_LOG_INFO("%s\n", angleBackend ? "Angle" : "Vulkan"); diff --git a/shell/windows/opengles/App.cpp b/shell/windows/opengles/App.cpp index 2176bb51b4..23bbac1bfb 100644 --- a/shell/windows/opengles/App.cpp +++ b/shell/windows/opengles/App.cpp @@ -139,6 +139,9 @@ GLFWwindow* initGLESWindow(const shell::RenderSessionConfig& config) { glfwSetKeyCallback(windowHandle, [](GLFWwindow* window, int key, int scancode, int action, int mods) { + if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { + glfwSetWindowShouldClose(window, GLFW_TRUE); + } if (key == GLFW_KEY_SPACE && action == GLFW_RELEASE) { angleBackend = !angleBackend; IGL_LOG_INFO("%s\n", angleBackend ? "Angle" : "Vulkan");