}
+static bool static_knobMouseWheelAlternateDirection = false;
+
class SGKnobAnimation::KnobPickCallback : public SGPickCallback {
public:
KnobPickCallback(const SGPropertyNode* configNode,
if ((button == 0) && (ea->getModKeyMask() & osgGA::GUIEventAdapter::MODKEY_ALT)) {
button = 1;
}
+
+ int increaseMouseWheel = static_knobMouseWheelAlternateDirection ? 3 : 4;
+ int decreaseMouseWheel = static_knobMouseWheelAlternateDirection ? 4 : 3;
_direction = DIRECTION_NONE;
- if ((button == 0) || (button == 4)) {
+ if ((button == 0) || (button == increaseMouseWheel)) {
_direction = DIRECTION_CLOCKWISE;
- } else if ((button == 1) || (button == 3)) {
+ } else if ((button == 1) || (button == decreaseMouseWheel)) {
_direction = DIRECTION_ANTICLOCKWISE;
} else {
return false;
return transform;
}
+void SGKnobAnimation::setAlternateMouseWheelDirection(bool aToggle)
+{
+ static_knobMouseWheelAlternateDirection = aToggle;
+}
+
SGPropertyNode* modelRoot);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
+ /**
+ * by default mouse wheel up corresponds to increment (CW)
+ * and mouse-wheel down corresponds to decrement (CCW).
+ * Since no one can agree on that, make it a global toggle.
+ */
+ static void setAlternateMouseWheelDirection(bool aToggle);
private:
class KnobPickCallback;
class UpdateCallback;