From 9eb61ecec024da8b91bcec3b69aa05b95d6a1af4 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 25 Jun 2019 12:31:19 -0400 Subject: [PATCH] Emulate middle-click with Ctrl-shift-click. --- src/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index 42b26e74..fd9b3c55 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -104,10 +104,15 @@ static void mouseButtonCallback(GLFWwindow *win, int button, int action, int mod Window *window = (Window*) glfwGetWindowUserPointer(win); #if defined ARCH_MAC // Remap Ctrl-left click to right click on Mac - if (button == GLFW_MOUSE_BUTTON_LEFT && (mods & GLFW_MOD_CONTROL)) { + if (button == GLFW_MOUSE_BUTTON_LEFT && (mods & RACK_MOD_MASK) == GLFW_MOD_CONTROL) { button = GLFW_MOUSE_BUTTON_RIGHT; mods &= ~GLFW_MOD_CONTROL; } + // Remap Ctrl-shift-left click to middle click on Mac + if (button == GLFW_MOUSE_BUTTON_LEFT && (mods & RACK_MOD_MASK) == (GLFW_MOD_CONTROL | GLFW_MOD_SHIFT)) { + button = GLFW_MOUSE_BUTTON_MIDDLE; + mods &= ~(GLFW_MOD_CONTROL | GLFW_MOD_SHIFT); + } #endif APP->event->handleButton(window->mousePos, button, action, mods);