Re: [osg-users] overriding keyboard events in osgViewer::View...
Thank you Robert. That helps a lot...:) -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Wednesday, January 07, 2009 4:55 AM To: OpenSceneGraph Users Subject: Re: [osg-users] overriding keyboard events in osgViewer::View... Hi Shayne, There are no default event handlers in osgViewer save for the escape sets done facility that you can turn off via viewer.setKeyEventSetsDone(0); >From your email it looks like you must be manually adding the osgGA::StateSetManipulator, and if you still want this functionality but want to customize the keys ysed just use the its setKeyEvent*() methods: void setKeyEventToggleBackfaceCulling(int key) { _keyEventToggleBackfaceCulling = key; } void setKeyEventToggleLighting(int key) { _keyEventToggleLighting = key; } void setKeyEventToggleTexturing(int key) { _keyEventToggleTexturing = key; } void setKeyEventCyclePolygonMode(int key) { _keyEventCyclePolygonMode = key; } Robert. On Wed, Jan 7, 2009 at 12:25 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote: > All, > > > > This may be a stupid and/or trivial question but here goes. > > > > Is there a way to override the default keyboard event handlers when using an > osgViewer::View class? For example, if I create a viewer and then press the > "l" (lowercase L) key, it causes my rendered scene to enable and disable > lighting. I want a different behavior when I press this key and other keys. > > > > Thanks, > > -Shayne > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] overriding keyboard events in osgViewer::View...
Hi Shayne, There are no default event handlers in osgViewer save for the escape sets done facility that you can turn off via viewer.setKeyEventSetsDone(0); >From your email it looks like you must be manually adding the osgGA::StateSetManipulator, and if you still want this functionality but want to customize the keys ysed just use the its setKeyEvent*() methods: void setKeyEventToggleBackfaceCulling(int key) { _keyEventToggleBackfaceCulling = key; } void setKeyEventToggleLighting(int key) { _keyEventToggleLighting = key; } void setKeyEventToggleTexturing(int key) { _keyEventToggleTexturing = key; } void setKeyEventCyclePolygonMode(int key) { _keyEventCyclePolygonMode = key; } Robert. On Wed, Jan 7, 2009 at 12:25 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote: > All, > > > > This may be a stupid and/or trivial question but here goes… > > > > Is there a way to override the default keyboard event handlers when using an > osgViewer::View class? For example, if I create a viewer and then press the > "l" (lowercase L) key, it causes my rendered scene to enable and disable > lighting. I want a different behavior when I press this key and other keys… > > > > Thanks, > > -Shayne > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] overriding keyboard events in osgViewer::View...
Hi, The Handlers can be set when you need them. By default, the statesetHandler is set, and manage the 'l' key for instance. If you make your own viewer, you can put the handlers you want. I'm not sure on how to remove the default handler, but If you set your view(er), and add the eventHandlers you need and nothing more, that will let you obtain what you need. Hope it can help you... Regards, Vincent. 2009/1/7 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC < shayne.tuel...@hill.af.mil> > All, > > > > This may be a stupid and/or trivial question but here goes… > > > > Is there a way to override the default keyboard event handlers when using > an osgViewer::View class? For example, if I create a viewer and then press > the "l" (lowercase L) key, it causes my rendered scene to enable and disable > lighting. I want a different behavior when I press this key and other keys… > > > > Thanks, > > -Shayne > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] overriding keyboard events in osgViewer::View...
All, This may be a stupid and/or trivial question but here goes. Is there a way to override the default keyboard event handlers when using an osgViewer::View class? For example, if I create a viewer and then press the "l" (lowercase L) key, it causes my rendered scene to enable and disable lighting. I want a different behavior when I press this key and other keys. Thanks, -Shayne smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org