@@ -15,8 +15,12 @@ void Knob::onDragStart() { | |||||
} | } | ||||
void Knob::onDragMove(Vec mouseRel) { | void Knob::onDragMove(Vec mouseRel) { | ||||
// Drag slower if Ctrl is held | |||||
// Drag slower if Ctrl is held (Command on Mac) | |||||
#ifdef ARCH_MAC | |||||
if (guiIsKeyPressed(GLFW_KEY_LEFT_SUPER) || guiIsKeyPressed(GLFW_KEY_RIGHT_SUPER)) | |||||
#else | |||||
if (guiIsKeyPressed(GLFW_KEY_LEFT_CONTROL) || guiIsKeyPressed(GLFW_KEY_RIGHT_CONTROL)) | if (guiIsKeyPressed(GLFW_KEY_LEFT_CONTROL) || guiIsKeyPressed(GLFW_KEY_RIGHT_CONTROL)) | ||||
#endif | |||||
mouseRel = mouseRel.mult(0.1); | mouseRel = mouseRel.mult(0.1); | ||||
setValue(value - KNOB_SENSITIVITY * (maxValue - minValue) * mouseRel.y); | setValue(value - KNOB_SENSITIVITY * (maxValue - minValue) * mouseRel.y); | ||||
} | } | ||||
@@ -35,6 +35,14 @@ void windowSizeCallback(GLFWwindow* window, int width, int height) { | |||||
} | } | ||||
void mouseButtonCallback(GLFWwindow *window, int button, int action, int mods) { | void mouseButtonCallback(GLFWwindow *window, int button, int action, int mods) { | ||||
#ifdef ARCH_MAC | |||||
// Ctrl-left click --> right click | |||||
if (button == GLFW_MOUSE_BUTTON_LEFT) { | |||||
if (guiIsKeyPressed(GLFW_KEY_LEFT_CONTROL) || guiIsKeyPressed(GLFW_KEY_RIGHT_CONTROL)) | |||||
button = GLFW_MOUSE_BUTTON_RIGHT; | |||||
} | |||||
#endif | |||||
if (action == GLFW_PRESS) { | if (action == GLFW_PRESS) { | ||||
// onMouseDown | // onMouseDown | ||||
Widget *w = gScene->onMouseDown(gMousePos, button); | Widget *w = gScene->onMouseDown(gMousePos, button); | ||||