[osg-users] How do I continuously read the mouse position as the mouse is moving, without a click event in osg

Kris Bartowski kpoloczek at vp.pl
Tue Feb 12 03:53:06 PST 2019


kornerr wrote:
> Hi.
> 
> Not sure why you "read" it during FRAME events. I personally create a
> class that:
> * inherits osgGA::GUIEventHandler
> * overrides its bool handle(const osgGA::GUIEventAdapter
> &eventAdapter, osgGA::GUIActionAdapter &actionAdapter, osg::Object
> *object, osg::NodeVisitor *visitor) method
> 
> bool handle(...) method is where you get notified of mouse events once
> you subscribe that class of yours to osg::Viewer events by using
> osg::Viewer's addEventHandler(...) method
> 
> For example, here's my Mouse class:
> https://github.com/OGStudio/openscenegraph-cross-platform-examples/blob/master/05.NodeSelection/desktop/src/input.h#L84
> 
> On Fri, 8 Feb 2019 at 14:03, Kris Bartowski <> wrote:
> 
> > 
> > Hi,
> > 
> > I want to read the mouse location at any time, but unfortunately when i try to read it for example when event type is FRAME, it always gives me the last clicked mouse coordinates.
> > 
> > Thank you!
> > 
> > Cheers,
> > Kris
> > 
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=75598#75598
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> _______________________________________________
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75621#75621







More information about the osg-users mailing list