Zoltán schrieb:
Or, is there a way to make an osgEventHandler from a SDL_JOYSTICK interface ? There is an osgviewerSDL in the examples (v2.3.4) but this is for an embedded OSG viewer inside an SDL window... would those work with a joystick ?
You can subclass from osgGA::GUIEventAdapter and add your joistick-data to it and feed it to the current event queue. In your eventhandler you can dynamic_cast to your subclassed Event-Adapter and read the joystick-data and handle it accordingly.
I am using this technique to feed the events from a SpaceNavigaor to a custom event-handler.
Or you encapsulate you joystick-data into a custom class and attach via setUserData to a GuiEventAdapter and push it with type USER to the eventqueue, and handling it in your event-handler.
You can even mimick a mouse by feeding the event-queue with fake mouse-events from your joystick-data.
HTH, Stephan _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

