~ubuntu-branches/ubuntu/trusty/libqglviewer/trusty

« back to all changes in this revision

Viewing changes to examples/keyboardAndMouse/keyboardAndMouse.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2013-12-28 14:57:47 UTC
  • mfrom: (7.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20131228145747-qy7hqddvex3oti0c
Tags: 2.5.0-1
* [f80a053] Imported Upstream version 2.5.0
* [c07abbe] Use wrap-and-sort.
* [89d8250] Remove google adsense-scripts.
* [4224be5] Set Standards-Versions: 3.9.5. No changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
 Copyright (C) 2002-2013 Gilles Debunne. All rights reserved.
4
4
 
5
 
 This file is part of the QGLViewer library version 2.4.0.
 
5
 This file is part of the QGLViewer library version 2.5.0.
6
6
 
7
7
 http://www.libqglviewer.com - contact@libqglviewer.com
8
8
 
91
91
  /////////////////////////////////////////////////////
92
92
 
93
93
  // Left and right buttons together make a camera zoom : emulates a mouse third button if needed.
94
 
  setMouseBinding(Qt::LeftButton + Qt::RightButton, CAMERA, ZOOM);
 
94
  setMouseBinding(Qt::NoModifier, Qt::LeftButton | Qt::RightButton, CAMERA, ZOOM);
95
95
 
96
96
  // Disable previous TRANSLATE mouse binding (and remove it from help mouse tab).
97
 
  setMouseBinding(Qt::RightButton, NO_CLICK_ACTION);
 
97
  setMouseBinding(Qt::NoModifier, Qt::RightButton, NO_CLICK_ACTION);
98
98
 
99
99
#if QT_VERSION < 0x040000
100
100
  // Alt+left button translates the camera (since right button will popup a menu).
101
 
  setMouseBinding(Qt::AltButton | Qt::LeftButton, CAMERA, TRANSLATE);
 
101
  setMouseBinding(Qt::AltButton, Qt::LeftButton, CAMERA, TRANSLATE);
102
102
  // Define Control+Shift+Right button as selection shortcut
103
 
  setMouseBinding(Qt::ControlButton | Qt::ShiftButton | Qt::RightButton, SELECT);
 
103
  setMouseBinding(Qt::ControlButton | Qt::ShiftButton, Qt::RightButton, SELECT);
104
104
  // Alt + mouse wheel MOVE_FORWARD the camera.
105
105
  setWheelBinding(Qt::AltButton, CAMERA, MOVE_FORWARD);
106
106
#else
107
 
  setMouseBinding(Qt::CTRL + Qt::SHIFT + Qt::RightButton, SELECT);
 
107
  setMouseBinding(Qt::ControlModifier | Qt::ShiftModifier, Qt::RightButton, SELECT);
108
108
  setWheelBinding(Qt::AltModifier, CAMERA, MOVE_FORWARD);
109
 
  setMouseBinding(Qt::ALT + Qt::LeftButton, CAMERA, TRANSLATE);
 
109
  setMouseBinding(Qt::AltModifier, Qt::LeftButton, CAMERA, TRANSLATE);
110
110
#endif
111
111
 
112
112
  // Add custom mouse bindings description (see mousePressEvent())
113
 
  setMouseBindingDescription(Qt::RightButton, "Opens a camera path context menu");
 
113
  setMouseBindingDescription(Qt::NoModifier, Qt::RightButton, "Opens a camera path context menu");
114
114
 
115
115
  // Display the help window. The help window tabs are automatically updated when you define new
116
116
  // standard key or mouse bindings (as is done above). Custom bindings descriptions are added using