On 04/08/2012 2:38 PM, Alberto Luaces wrote:
I think if you write an osgGA::GUIEventHandler that reports that you
handled the ESC key (by returning true), the viewer won't do its own
processing.
In addition to this, I suggest you look into the following methods of
the osgViewer::ViewerBase class (which both CompositeViewer and Viewer
inherit):
/** Set the key event that the viewer checks on each frame to
see if the viewer's done flag should be set to
* signal end of viewers main loop.
* Default value is Escape (osgGA::GUIEVentAdapter::KEY_Escape).
* Setting to 0 switches off the feature.*/
void setKeyEventSetsDone(int key) { _keyEventSetsDone = key; }
/** get the key event that the viewer checks on each frame to
see if the viewer's done flag.*/
int getKeyEventSetsDone() const { return _keyEventSetsDone; }
/** if the flag is true, the viewer set its done flag when a
QUIT_APPLICATION is received, false disables this feature */
void setQuitEventSetsDone(bool flag) { _quitEventSetsDone = flag; }
/** @return true if the viewer respond to the
QUIT_APPLICATION-event */
bool getQuitEventSetsDone() const { return _quitEventSetsDone; }
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean_...@videotron.ca
http://whitestar02.dyndns-web.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org