From eaaf7589105f6cf097a69d4009c0d7c731c1d26c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 17 Jan 2003 20:05:41 +0000 Subject: [PATCH] Added KeyboardMouse::allowContinousMouseMotionUpdate(), but commented out right now as Producer crashes when you use it.. --- src/Demos/osgproducer/osgproducer.cpp | 2 ++ src/osgProducer/EventAdapter.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Demos/osgproducer/osgproducer.cpp b/src/Demos/osgproducer/osgproducer.cpp index d41fff1a8..7fa414b4a 100644 --- a/src/Demos/osgproducer/osgproducer.cpp +++ b/src/Demos/osgproducer/osgproducer.cpp @@ -133,9 +133,11 @@ int main( int argc, char **argv ) // register the callback with the keyboard mouse manger. kbm->setCallback( &kbmcb ); + //kbm->allowContinuousMouseMotionUpdate(true); kbm->startThread(); + // set the globa state osg::ref_ptr globalStateSet = new osg::StateSet; globalStateSet->setGlobalDefaults(); diff --git a/src/osgProducer/EventAdapter.cpp b/src/osgProducer/EventAdapter.cpp index f1a0dbc5f..cf4f3bc41 100644 --- a/src/osgProducer/EventAdapter.cpp +++ b/src/osgProducer/EventAdapter.cpp @@ -134,11 +134,16 @@ void EventAdapter::adaptButtonRelease(double time,float x, float y, unsigned int /** method for adapting mouse motion events whilst mouse buttons are pressed.*/ void EventAdapter::adaptMouseMotion(double time, float x, float y) { - _eventType = DRAG; + + _eventType = (_s_accumulatedButtonMask) ? + DRAG : + MOVE; + _time = time; _s_mx = (int)(x*(float)(_s_Xmax-_s_Xmin))+_s_Xmin; _s_my = (int)(y*(float)(_s_Ymin-_s_Ymax))+_s_Ymax; copyStaticVariables(); + }