| 146 | |
| 147 | |
| 148 | static void mouseButtonCallback(GLFWwindow* win, int button, int action, int mods) { |
| 149 | contextSet((Context*) glfwGetWindowUserPointer(win)); |
| 150 | #if defined ARCH_MAC |
| 151 | // Remap Ctrl-left click to right click on Mac |
| 152 | if (button == GLFW_MOUSE_BUTTON_LEFT && (mods & RACK_MOD_MASK) == GLFW_MOD_CONTROL) { |
| 153 | button = GLFW_MOUSE_BUTTON_RIGHT; |
| 154 | mods &= ~GLFW_MOD_CONTROL; |
| 155 | } |
| 156 | // Remap Ctrl-shift-left click to middle click on Mac |
| 157 | if (button == GLFW_MOUSE_BUTTON_LEFT && (mods & RACK_MOD_MASK) == (GLFW_MOD_CONTROL | GLFW_MOD_SHIFT)) { |
| 158 | button = GLFW_MOUSE_BUTTON_MIDDLE; |
| 159 | mods &= ~(GLFW_MOD_CONTROL | GLFW_MOD_SHIFT); |
| 160 | } |
| 161 | #endif |
| 162 | |
| 163 | APP->event->handleButton(APP->window->internal->lastMousePos, button, action, mods); |
| 164 | } |
| 165 | |
| 166 | |
| 167 | static void cursorPosCallback(GLFWwindow* win, double xpos, double ypos) { |
nothing calls this directly
no test coverage detected