Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 25, 2008, 5:04:26 PM (16 years ago)
Author:
rgrieder
Message:
  • created InputEventListener and InputEvent
  • escape key now works through the InputHandler
  • the concept will soon be replaced by a new one this is more of a 'svn save' ;)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/Orxonox.cc

    r919 r922  
    3737#include <OgreException.h>
    3838#include <OgreRoot.h>
    39 #include <OgreFrameListener.h>
    4039#include <OgreRenderWindow.h>
    4140#include <OgreTextureManager.h>
     
    373372  }
    374373
    375 
     374  /**
     375    @brief Calls the InputHandler which sets up the input devices.
     376    The render window width and height are used to set up the mouse movement.
     377  */
    376378  void Orxonox::setupInputSystem()
    377379  {
     
    379381    inputHandler_->initialise(ogre_->getWindowHandle(),
    380382          ogre_->getWindowWidth(), ogre_->getWindowHeight());
    381 
    382     /*size_t windowHnd = 0;
    383     std::ostringstream windowHndStr;
    384     OIS::ParamList pl;
    385 
    386     // fixes auto repeat problem
    387     #if defined OIS_LINUX_PLATFORM
    388       pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
    389     #endif
    390 
    391       Ogre::RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow();
    392     win->getCustomAttribute("WINDOW", &windowHnd);
    393     windowHndStr << windowHnd;
    394     pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
    395     inputManager_ = OIS::InputManager::createInputSystem(pl);
    396 
    397     try
    398     {
    399       keyboard_ = static_cast<OIS::Keyboard*>(inputManager_->createInputObject(OIS::OISKeyboard, false));
    400       mouse_ = static_cast<OIS::Mouse*>(inputManager_->createInputObject(OIS::OISMouse, true));
    401     }
    402     catch (const OIS::Exception &e)
    403     {
    404       throw new Ogre::Exception(42, e.eText, "OrxApplication::setupInputSystem");
    405     }*/
    406383  }
    407384
     
    512489    return (float)(times.back() - times.front()) / ((times.size()-1) * 1000);
    513490  }
     491
     492  void Orxonox::eventOccured(InputEvent &evt)
     493  {
     494    if (evt.id == 1)
     495      this->abortRequest();
     496  }
    514497}
Note: See TracChangeset for help on using the changeset viewer.