[osg-submissions] Updated osgviewerWX example
Robert Osfield
robert.osfield at gmail.com
Mon May 26 13:08:23 PDT 2008
Thanks Paul, changes now merged and submitted to SVN.
On Wed, May 14, 2008 at 4:16 PM, Paul Melis <paul at science.uva.nl> wrote:
> Hi Robert,
>
> Here is an update to the osgviewerWX example. Keyboard events were not
> always received because the GraphicsWindowWX wasn't receiving focus. It now
> receives focus when the mouse enters the window.
> * I split the mouse handling from a monolithic method to separate ones,
> slightly cleaner than a whole bunch of if()'s, especially with another case
> of the mouse entering the canvas.
> * I changed the EVT_KEY_DOWN handler to an EVT_CHAR handler, although that
> now makes the up and down handler assymetric. The new down-handler returns
> translated key codes, so when you press the S key (without anything else),
> it actually returns 's' and not 'S' as the EVT_KEY_DOWN did. This means that
> statistics can be called up in the viewer window, while the example
> previously only printed a "Stats output:" line to the console. I'm not truly
> happy that the up handler returns _untranslated_ key codes. But solving this
> completely would probably mean adding some table that translated from
> wxWidgets' untranslated key codes to OSG's internal ones. This might be
> interesting to add, as anyone using OSG + wxWidgets in any serious manner
> would also have to add this.
> * I commented out the evt.Skip()'s in the keyboard handlers as these would
> only be necessary if there were some key events that are not handled. But
> currently all key events are simply forwarded.
> * I changed the handling of a mouse drag to a more general mouse move
>
> Paul
>
> _______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
More information about the osg-submissions
mailing list