Browse Source

Emulate middle-click with Ctrl-shift-click.

tags/v1.1.0
Andrew Belt 5 years ago
parent
commit
9eb61ecec0
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/window.cpp

+ 6
- 1
src/window.cpp View File

@@ -104,10 +104,15 @@ static void mouseButtonCallback(GLFWwindow *win, int button, int action, int mod
Window *window = (Window*) glfwGetWindowUserPointer(win); Window *window = (Window*) glfwGetWindowUserPointer(win);
#if defined ARCH_MAC #if defined ARCH_MAC
// Remap Ctrl-left click to right click on 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; button = GLFW_MOUSE_BUTTON_RIGHT;
mods &= ~GLFW_MOD_CONTROL; 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 #endif


APP->event->handleButton(window->mousePos, button, action, mods); APP->event->handleButton(window->mousePos, button, action, mods);


Loading…
Cancel
Save