Hi Pedro,

Stephan Huber schrieb:
What viewer-lib and what version of osg are you using? The code worked some time ago, I haven't tested it with newer version of osg, so perhaps some refactoring broke the code. I'll test it the next days.


I did a quick test with my own code and the pen-type seems to be correct. Perhaps your implementation is different than mine. Here's a snippet of my event-handler which reports the pen-type correctly: The tabletpointertype is only set when a pen entered or leaved the tablet.


virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* o, osg::NodeVisitor* nv) {
           switch (ea.getEventType()) {
               case osgGA::GUIEventAdapter::PEN_PROXIMITY_ENTER:
osg::notify(osg::ALWAYS) << "Pen entering proximity-range: " << ea.getTabletPointerType() << std::endl;
                   break;
case osgGA::GUIEventAdapter::PEN_PROXIMITY_LEAVE: osg::notify(osg::ALWAYS) << "Pen leaving proximity-range: " << ea.getTabletPointerType() << std::endl;
                   break;
case osgGA::GUIEventAdapter::PEN_PRESSURE: std::cout << "pressure: " << ea.getEventType() << std::endl;
                   _targetPressure = 10 * ea.getPenPressure();
                   return true;
                   break;
            }
}

I am using a post 1.2 osg-version with Producer/osgProducer -- it should also work with the new osgViewer-code, but I have not tested it yet.

HTH,
Stephan
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to