hi,

I am new to osg and so I have some beginner troubles

one is, that when I write a eventhandler for keyboardinput, keyup und
keydown events repeat when a key is pressed for a longer time (0.5 secund
or so)
is this the normal behavior?
is there a chance to avoid the repeat of up and down events while a key is
pressed?

code for eventhandler looks like this, from the samples

//header
class MyEventHandler : public osgGA::GUIEventHandler {

public:
MyEventHandler();
virtual ~MyEventHandler();
virtual bool handle(const osgGA::GUIEventAdapter&
ea,osgGA::GUIActionAdapter&);

};


//impl
MyEventHandler::MyEventHandler()
{

}

//-------------------------------------------------------------------------------

MyEventHandler::~MyEventHandler()
{

}

//-------------------------------------------------------------------------------

bool
MyEventHandler::handle(const osgGA::GUIEventAdapter&
ea,osgGA::GUIActionAdapter& aa)
{

        switch(ea.getEventType())   {

                case(osgGA::GUIEventAdapter::KEYDOWN): {
                        std::cout << "KEYDOWN" << std::endl;
                        break;
                }

                case(osgGA::GUIEventAdapter::KEYUP): {
                        std::cout << "KEYUP" << std::endl;
                        break;
                }
        }


}


thanks for help

gwg
harri


_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to