From ab30d09cda0aaf4309d79c1a3d9047a6abfc3e78 Mon Sep 17 00:00:00 2001 From: pbrt4bounty <73945652+pbrt4bounty@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:26:51 +0200 Subject: [PATCH] Change to use the middle button of the mouse in GUI mode Change to use the middle button of the mouse in GUI mode to release the left button to other tasks, like, manage menus --- src/pbrt/util/gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pbrt/util/gui.cpp b/src/pbrt/util/gui.cpp index 51d219f28..a3b415515 100644 --- a/src/pbrt/util/gui.cpp +++ b/src/pbrt/util/gui.cpp @@ -185,11 +185,11 @@ static void glfwKeyCallback(GLFWwindow* window, int key, int scan, int action, i } void GUI::mouseButtonCallback(GLFWwindow* window, int button, int action, int mods) { - if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS) { + if (button == GLFW_MOUSE_BUTTON_MIDDLE && action == GLFW_PRESS) { pressed = true; glfwGetCursorPos(window, &lastX, &lastY); } - if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_RELEASE) { + if (button == GLFW_MOUSE_BUTTON_MIDDLE && action == GLFW_RELEASE) { pressed = false; } }