   keyboardhandler class help
  Hi,I am trying to write a program where I load some CAD objects and then try to move them and manipulate parts of them using a keyboard handler.I found the example on the osg tutorials page but I'm having the following problem:How I can modify the function that is in keyboardhandler.h which is currently:typedef void (*functionType) (); //change this to the one below:typedef void (*functionType) (osg::PositionAttitudeTransform* PAT, double& value);The reason I want to do this is because for example a function like: void moveForward(osg::PositionAttitudeTransform* PAT, double& value);//in my main()I want to pass it a PAT node and the value of either x/y/z coordinate and modify it in the function. Currently the way I have it setup doesnt allow me to pass paramters so I have to keep these values as global variables so they can be accessed by any function. But I want to avoid this. ----------------------------------------------------------------------------------------------------------------------------------------------------------------For reference I will copy the keyboard handler class below:class keyboardEventHandler : public osgGA::GUIEventHandler{public:   typedef void (*functionType) ();   enum keyStatusType   { KEY_UP, KEY_DOWN    };   struct functionStatusType   { functionStatusType(){keyState = KEY_UP; keyFunction = NULL;} functionType keyFunction; keyStatusType keyState;   };   bool addFunction(int whatKey, functionType newFunction);   bool addFunction(int whatKey, keyStatusType keyPressStatus, functionType newFunction);   virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&);   virtual void accept(osgGA::GUIEventHandlerVisitor& v)   { v.visit(*this); };protected:   typedef std::map<int, functionStatusType > keyFunctionMap;   keyFunctionMap keyFuncMap;   keyFunctionMap keyUPFuncMap;};   
  I forgot to post the keyboardhandler.cpp file so:bool keyboardEventHandler::addFunction(int whatKey, functionType newFunction){   if ( keyFuncMap.end() != keyFuncMap.find( whatKey ))   { std::cout << "duplicate key '" << whatKey << "' ignored." << std::endl; return false;   }   else   { keyFuncMap[whatKey].keyFunction = newFunction; return true;   }}bool keyboardEventHandler::addFunction (int whatKey, keyStatusType keyPressStatus, functionType newFunction){   if (keyPressStatus == KEY_DOWN)   { return addFunction(whatKey,newFunction);   }   else   { if ( keyUPFuncMap.end() != keyUPFuncMap.find( whatKey ))  {    std::cout << "duplicate key '" << whatKey << "' ignored." << std::endl;    return false; } else {    keyUPFuncMap[whatKey].keyFunction = newFunction;    return true; }   } // KEY_UP}bool keyboardEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa){   bool newKeyDownEvent = false;   bool newKeyUpEvent   = false;   switch(ea.getEventType())   {   case(osgGA::GUIEventAdapter::KEYDOWN): {    keyFunctionMap::iterator itr = keyFuncMap.find(ea.getKey());    if (itr != keyFuncMap.end())    {  if ( (*itr).second.keyState == KEY_UP )  {(*itr).second.keyState = KEY_DOWN;newKeyDownEvent = true;  }  if (newKeyDownEvent)  {(*itr).second.keyFunction;newKeyDownEvent = false;  }  return true;    }    return false; }   case(osgGA::GUIEventAdapter::KEYUP): {    keyFunctionMap::iterator itr = keyFuncMap.find(ea.getKey());    if (itr != keyFuncMap.end() )    {  (*itr).second.keyState = KEY_UP;    }    itr = keyUPFuncMap.find(ea.getKey());    if (itr != keyUPFuncMap.end())    {  (*itr).second.keyFunction;  return true;    }    return false;  }   default: return false;   }}   