Skip to content
Snippets Groups Projects
Commit 75087974 authored by sdegrande's avatar sdegrande
Browse files

[OpenXR] Escape key now works even with unworn headset.

When the escape key is pressed, immediately close the session when
the session is stopped.
parent f5d0b306
No related branches found
No related tags found
No related merge requests found
......@@ -1164,13 +1164,18 @@ void OpenXRSet::keyCallback(GLFWwindow* window, int key, int scancode, int actio
{
bool eaten { false };
if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE) {
xrRequestExitSession(oxrConn.session);
return;
}
if (action == GLFW_PRESS) {
switch (key) {
case GLFW_KEY_ESCAPE:
{
auto result = xrRequestExitSession(oxrConn.session);
if (result == XR_ERROR_SESSION_NOT_RUNNING) {
// immediate close
close();
}
eaten = true;
}
break;
case GLFW_KEY_S:
takeScreenshot("test");
eaten = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment