Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
pbrt4bounty authored Oct 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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
@@ -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;
}
}

0 comments on commit ab30d09

Please sign in to comment.