diff --git a/include/osgUtil/GUIEventAdapter b/include/osgUtil/GUIEventAdapter index 53bd5c9f7..a2c6384f7 100644 --- a/include/osgUtil/GUIEventAdapter +++ b/include/osgUtil/GUIEventAdapter @@ -26,9 +26,9 @@ class GUIEventAdapter : public osg::Referenced enum MouseButtonMask { - LEFT_BUTTON=1, - MIDDLE_BUTTON=2, - RIGHT_BUTTON=4 + LEFT_MOUSE_BUTTON=1, + MIDDLE_MOUSE_BUTTON=2, + RIGHT_MOUSE_BUTTON=4 }; enum EventType { diff --git a/src/Demos/hangglide/GliderManipulator.cpp b/src/Demos/hangglide/GliderManipulator.cpp index 139a87c7a..92aeda757 100644 --- a/src/Demos/hangglide/GliderManipulator.cpp +++ b/src/Demos/hangglide/GliderManipulator.cpp @@ -187,21 +187,21 @@ bool GliderManipulator::calcMovement() } unsigned int buttonMask = _ga_t1->getButtonMask(); - if (buttonMask==GUIEventAdapter::LEFT_BUTTON) + if (buttonMask==GUIEventAdapter::LEFT_MOUSE_BUTTON) { // pan model. _velocity += dt*_modelScale*0.05f; } - else if (buttonMask==GUIEventAdapter::MIDDLE_BUTTON || - buttonMask==(GUIEventAdapter::LEFT_BUTTON|GUIEventAdapter::RIGHT_BUTTON)) + else if (buttonMask==GUIEventAdapter::MIDDLE_MOUSE_BUTTON || + buttonMask==(GUIEventAdapter::LEFT_MOUSE_BUTTON|GUIEventAdapter::RIGHT_MOUSE_BUTTON)) { _velocity = 0.0f; } - else if (buttonMask==GUIEventAdapter::RIGHT_BUTTON) + else if (buttonMask==GUIEventAdapter::RIGHT_MOUSE_BUTTON) { _velocity -= dt*_modelScale*0.05f; diff --git a/src/osgGLUT/GLUTEventAdapter.cpp b/src/osgGLUT/GLUTEventAdapter.cpp index fd6ea201e..15e2c30f4 100644 --- a/src/osgGLUT/GLUTEventAdapter.cpp +++ b/src/osgGLUT/GLUTEventAdapter.cpp @@ -99,9 +99,9 @@ void GLUTEventAdapter::adaptMouse(float time, int button, int state, int x, int switch(button) { - case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | LEFT_BUTTON; break; - case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | MIDDLE_BUTTON; break; - case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | RIGHT_BUTTON; break; + case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | LEFT_MOUSE_BUTTON; break; + case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | MIDDLE_MOUSE_BUTTON; break; + case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | RIGHT_MOUSE_BUTTON; break; } } @@ -113,9 +113,9 @@ void GLUTEventAdapter::adaptMouse(float time, int button, int state, int x, int switch(button) { - case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~LEFT_BUTTON; break; - case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~MIDDLE_BUTTON; break; - case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~RIGHT_BUTTON; break; + case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~LEFT_MOUSE_BUTTON; break; + case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~MIDDLE_MOUSE_BUTTON; break; + case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~RIGHT_MOUSE_BUTTON; break; } } diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index 928e949eb..c7a47662d 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -739,9 +739,9 @@ void Viewer::mouse(int button, int state, int x, int y) // Switch viewport focus if button is pressed, and it is the only one unsigned mask = ea->getButtonMask(); if (state == GLUT_DOWN && - (mask == osgUtil::GUIEventAdapter::LEFT_BUTTON || - mask == osgUtil::GUIEventAdapter::MIDDLE_BUTTON || - mask == osgUtil::GUIEventAdapter::RIGHT_BUTTON)) + (mask == osgUtil::GUIEventAdapter::LEFT_MOUSE_BUTTON || + mask == osgUtil::GUIEventAdapter::MIDDLE_MOUSE_BUTTON || + mask == osgUtil::GUIEventAdapter::RIGHT_MOUSE_BUTTON)) { int focus = mapWindowXYToSceneView(x,y); if (focus >= 0 && focus != int(_focusedViewport)) diff --git a/src/osgUtil/DriveManipulator.cpp b/src/osgUtil/DriveManipulator.cpp index 780d22adf..0fe9191cb 100644 --- a/src/osgUtil/DriveManipulator.cpp +++ b/src/osgUtil/DriveManipulator.cpp @@ -390,21 +390,21 @@ bool DriveManipulator::calcMovement() case(USE_MOUSE_BUTTONS_FOR_SPEED): { unsigned int buttonMask = _ga_t1->getButtonMask(); - if (buttonMask==GUIEventAdapter::LEFT_BUTTON) + if (buttonMask==GUIEventAdapter::LEFT_MOUSE_BUTTON) { // pan model. _velocity += dt*_modelScale*0.02f; } - else if (buttonMask==GUIEventAdapter::MIDDLE_BUTTON || - buttonMask==(GUIEventAdapter::LEFT_BUTTON|GUIEventAdapter::RIGHT_BUTTON)) + else if (buttonMask==GUIEventAdapter::MIDDLE_MOUSE_BUTTON || + buttonMask==(GUIEventAdapter::LEFT_MOUSE_BUTTON|GUIEventAdapter::RIGHT_MOUSE_BUTTON)) { _velocity = 0.0f; } - else if (buttonMask==GUIEventAdapter::RIGHT_BUTTON) + else if (buttonMask==GUIEventAdapter::RIGHT_MOUSE_BUTTON) { _velocity -= dt*_modelScale*0.02f; diff --git a/src/osgUtil/FlightManipulator.cpp b/src/osgUtil/FlightManipulator.cpp index d3e5461de..c93c3a972 100644 --- a/src/osgUtil/FlightManipulator.cpp +++ b/src/osgUtil/FlightManipulator.cpp @@ -184,21 +184,21 @@ bool FlightManipulator::calcMovement() } unsigned int buttonMask = _ga_t1->getButtonMask(); - if (buttonMask==GUIEventAdapter::LEFT_BUTTON) + if (buttonMask==GUIEventAdapter::LEFT_MOUSE_BUTTON) { // pan model. _velocity += dt*_modelScale*0.05f; } - else if (buttonMask==GUIEventAdapter::MIDDLE_BUTTON || - buttonMask==(GUIEventAdapter::LEFT_BUTTON|GUIEventAdapter::RIGHT_BUTTON)) + else if (buttonMask==GUIEventAdapter::MIDDLE_MOUSE_BUTTON || + buttonMask==(GUIEventAdapter::LEFT_MOUSE_BUTTON|GUIEventAdapter::RIGHT_MOUSE_BUTTON)) { _velocity = 0.0f; } - else if (buttonMask==GUIEventAdapter::RIGHT_BUTTON) + else if (buttonMask==GUIEventAdapter::RIGHT_MOUSE_BUTTON) { _velocity -= dt*_modelScale*0.05f; diff --git a/src/osgUtil/TrackballManipulator.cpp b/src/osgUtil/TrackballManipulator.cpp index 5694c2e5a..d2f88e988 100644 --- a/src/osgUtil/TrackballManipulator.cpp +++ b/src/osgUtil/TrackballManipulator.cpp @@ -202,7 +202,7 @@ bool TrackballManipulator::calcMovement() float focalLength = (_camera->getCenterPoint()-_camera->getEyePoint()).length(); unsigned int buttonMask = _ga_t1->getButtonMask(); - if (buttonMask==GUIEventAdapter::LEFT_BUTTON) + if (buttonMask==GUIEventAdapter::LEFT_MOUSE_BUTTON) { // rotate camera. @@ -241,8 +241,8 @@ bool TrackballManipulator::calcMovement() return true; } - else if (buttonMask==GUIEventAdapter::MIDDLE_BUTTON || - buttonMask==(GUIEventAdapter::LEFT_BUTTON|GUIEventAdapter::RIGHT_BUTTON)) + else if (buttonMask==GUIEventAdapter::MIDDLE_MOUSE_BUTTON || + buttonMask==(GUIEventAdapter::LEFT_MOUSE_BUTTON|GUIEventAdapter::RIGHT_MOUSE_BUTTON)) { // pan model. @@ -262,7 +262,7 @@ bool TrackballManipulator::calcMovement() return true; } - else if (buttonMask==GUIEventAdapter::RIGHT_BUTTON) + else if (buttonMask==GUIEventAdapter::RIGHT_MOUSE_BUTTON) { // zoom model. diff --git a/src/osgWX/WXEventAdapter.cpp b/src/osgWX/WXEventAdapter.cpp index ab3dc8c35..6171e733c 100644 --- a/src/osgWX/WXEventAdapter.cpp +++ b/src/osgWX/WXEventAdapter.cpp @@ -104,27 +104,27 @@ void WXEventAdapter::adaptMouse(float time, wxMouseEvent *event) if ( type == wxEVT_LEFT_DOWN ) { _eventType = PUSH; - _s_accumulatedButtonMask = _s_accumulatedButtonMask | LEFT_BUTTON; + _s_accumulatedButtonMask = _s_accumulatedButtonMask | LEFT_MOUSE_BUTTON; } else if ( type == wxEVT_LEFT_UP ) { _eventType = RELEASE; - _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~LEFT_BUTTON; + _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~LEFT_MOUSE_BUTTON; } else if ( type == wxEVT_MIDDLE_DOWN ) { _eventType = PUSH; - _s_accumulatedButtonMask = _s_accumulatedButtonMask | MIDDLE_BUTTON; + _s_accumulatedButtonMask = _s_accumulatedButtonMask | MIDDLE_MOUSE_BUTTON; } else if ( type == wxEVT_MIDDLE_UP ) { _eventType = RELEASE; - _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~MIDDLE_BUTTON; + _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~MIDDLE_MOUSE_BUTTON; } else if ( type == wxEVT_RIGHT_DOWN ) { _eventType = PUSH; - _s_accumulatedButtonMask = _s_accumulatedButtonMask | RIGHT_BUTTON; + _s_accumulatedButtonMask = _s_accumulatedButtonMask | RIGHT_MOUSE_BUTTON; } else if ( type == wxEVT_RIGHT_UP ) { _eventType = RELEASE; - _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~RIGHT_BUTTON; + _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~RIGHT_MOUSE_BUTTON; } else if ( type == wxEVT_MOTION ) { if (event->ButtonIsDown(-1))