From 98f691f693e909aee3b8509502953be8f789bd8d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 6 Apr 2003 21:46:48 +0000 Subject: [PATCH] Added if (!_kbmcb) to handle the case where the keyboard mouse callback is pre set. --- src/osgProducer/Viewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index 76711525a..540828a2a 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -88,7 +88,9 @@ void Viewer::setUpViewer(unsigned int options) _start_tick = _timer.tick(); // set the keyboard mouse callback to catch the events from the windows. - _kbmcb = new osgProducer::KeyboardMouseCallback( kbm, _done, (options & ESCAPE_SETS_DONE)!=0 ); + if (!_kbmcb) + _kbmcb = new osgProducer::KeyboardMouseCallback( kbm, _done, (options & ESCAPE_SETS_DONE)!=0 ); + _kbmcb->setStartTick(_start_tick); // register the callback with the keyboard mouse manger.