Skip to content

Commit

Permalink
Change to use the middle button of the mouse in GUI mode
Browse files Browse the repository at this point in the history
Change to use the middle button of the mouse in GUI mode to release the left button to other tasks, like, manage menus
  • Loading branch information
pbrt4bounty authored Oct 15, 2024
1 parent 710bc1a commit ab30d09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pbrt/util/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit ab30d09

Please sign in to comment.