Hi, I want to have one of the nodes in my scene graph respond to key presses by giving it an event callback. When the callback gets an EventVisitor containing a KEYDOWN event, I want it to eat that event and keep others from seeing it.
I noticed that EventVisitors have the capacity to contain a whole list of events, not just one. I also noticed that, at least for my simple app, this list always contains only one event. Do EventVisitors ever contain more than one event? If so, how should I get my callback to "eat" certain key events while leaving the other events alone? I can think of two approaches: [list=] Remove the event from the EventVisitor's event list, using std::list::erase(). Call GUIEventAdapter::setHandled(true) on the key event we want to eat. [/list] Which approach is better? On the other hand, if EventVisitors only ever contain one event, I assume I can "eat" the event by simply not calling traverse() in my callback. I'm worried, however, that this might make my app less future-proof, in the event that future versions of OSG start putting multiple events into single EventVisitors. Is this a valid concern? Any help would be greatly appreciated, -- Matt[/list] ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35108#35108 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org