Hi Charles,
The spacebar event is caught by the manipulator - if you "throw" the model to make it spin, hitting space should stop the rotation. Basically, all events are pushed onto the OSG event queue by the calls to getEventQueue()->*. Internally, each event handler that has been added to the view (the manipulator, the stats handler etc) is given a chance to handle each event as it is taken off the queue. The catch is that some handlers deal with an event, then stop that event from begin passed onto any further handlers (typically, this is a good thing ...). I've had a quick look at the latest SVN and it appears as though the key events are caught by the OnKey* handlers, but for some reason the stats are not being displayed ... I don't have time to look further into this today, but I will over the weekend ... unless some one else has any ideas first. Gian I don't know -- whichever osg event handler it is that *does* successfully catch the spacebar event. I recompiled the osgviewerWX example with my 3 line addition and it works, but if don't tell it to use key=32 it doesn't work. When there are no special graphics contexts, of course, the "s" key toggles the stats just fine, so my guess was that wx is doing something with the s-key event. I guess by "osg event handler", therefore, i just mean the StatsHandler. -c On 7/5/07, Charles Cosse <[EMAIL PROTECTED]> wrote: > Hi, below is a section of code from osgsimpleviewerWX.cpp example witth > 3 lines added to get osgViewer::StatsHandler working in the WX window. > On my implementation, at least, the "s" key (intval=65) event doesn't > propagate > to the osg event handler, but the spacebar key (intval=32) does. So, as you > can see from below, telling the StatsHandler to use the spacebar key event > works. > > Still wondering why the "s" key event doesn't get beyond the wx event hander > implementation...if that's really even the problem... > > -Charles > > -------- @line=52 > osgsimpleviewerWX.cpp--------------------------------------------- > > viewer->setSceneData(loadedModel.get()); > viewer->setCameraManipulator(new > osgGA::TrackballManipulator); > > /*begin new code*/ > osgViewer::StatsHandler *stats_handler=new osgViewer::StatsHandler(); > > stats_handler->setKeyEventTogglesOnScreenStats(32);//SPACEBAR > viewer->addEventHandler(stats_handler); > /*end new code*/ > > frame->SetViewer(viewer); > > > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/