MCPcopy Create free account
hub / github.com/VCVRack/Rack / mouseButtonCallback

Function mouseButtonCallback

src/window/Window.cpp:148–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146
147
148static 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
167static void cursorPosCallback(GLFWwindow* win, double xpos, double ypos) {

Callers

nothing calls this directly

Calls 2

contextSetFunction · 0.85
handleButtonMethod · 0.80

Tested by

no test coverage detected