summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-11-30 21:47:13 (GMT)
committerMarius Kintel <marius@kintel.net>2011-11-30 21:47:13 (GMT)
commit24d7edd8cab9cf359ccd89bf88bf7a55e2cfc21b (patch)
treee08bded759e0570d283f54e325cd58bfc4eea5c8
parentfc9847f6250a53822bc23d5c500ba4a561efeb86 (diff)
fix: Ctrl-Left drag on Mac now behaves as right-drag on other platforms
-rw-r--r--src/glview.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/glview.cc b/src/glview.cc
index b3ac966..8454cd6 100644
--- a/src/glview.cc
+++ b/src/glview.cc
@@ -535,7 +535,14 @@ void GLView::mouseMoveEvent(QMouseEvent *event)
double dx = (this_mouse.x()-last_mouse.x()) * 0.7;
double dy = (this_mouse.y()-last_mouse.y()) * 0.7;
if (mouse_drag_active) {
- if ((event->buttons() & Qt::LeftButton) != 0) {
+ int i = event->buttons();
+ if (event->buttons() & Qt::LeftButton
+#ifdef Q_WS_MAC
+ && !(event->modifiers() & Qt::MetaModifier)
+#endif
+ ) {
+ // Left button rotates in xz, Shift-left rotates in xy
+ // On Mac, Ctrl-Left is handled as right button on other platforms
object_rot_x += dy;
if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0)
object_rot_y += dx;
@@ -546,6 +553,8 @@ void GLView::mouseMoveEvent(QMouseEvent *event)
normalizeAngle(object_rot_y);
normalizeAngle(object_rot_z);
} else {
+ // Right button pans
+ // Shift-right zooms
if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) {
viewer_distance += (GLdouble)dy;
} else {
contact: Jan Huwald // Impressum