Index: code/branches/network/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/network/src/orxonox/CMakeLists.txt	(revision 921)
+++ code/branches/network/src/orxonox/CMakeLists.txt	(revision 922)
@@ -2,4 +2,5 @@
   GraphicsEngine.cc
   InputHandler.cc
+  InputEventListener.cc
   Main.cc
   Orxonox.cc
Index: code/branches/network/src/orxonox/InputEvent.h
===================================================================
--- code/branches/network/src/orxonox/InputEvent.h	(revision 922)
+++ code/branches/network/src/orxonox/InputEvent.h	(revision 922)
@@ -0,0 +1,52 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ @file
+ @brief InputEvent Structure declaration
+ */
+
+#ifndef _InputEvent_H__
+#define _InputEvent_H__
+
+#include "OrxonoxPrereqs.h"
+
+namespace orxonox
+{
+  /**
+    @brief Interface that any class can use to get key independent input.
+  */
+  struct InputEvent
+  {
+    unsigned char id;      //!< Event ID
+    bool bStarted;         //!< Tells whether the Event started or ended (e.g. firing started)
+    int data1, data2;      //!< Two additional integer datafields, for instance for the mouse moved event
+    void* dataRef;         //!< Additional pointer to any further data
+  };
+}
+
+#endif /* _InputEvent_H__ */
Index: code/branches/network/src/orxonox/InputEventListener.cc
===================================================================
--- code/branches/network/src/orxonox/InputEventListener.cc	(revision 922)
+++ code/branches/network/src/orxonox/InputEventListener.cc	(revision 922)
@@ -0,0 +1,53 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      Some guy writing the example code from Ogre
+ *
+ */
+
+/**
+ @file
+ @brief Core relevant parts of InputEventListener
+ */
+
+#include "OrxonoxStableHeaders.h"
+
+#include "core/CoreIncludes.h"
+#include "InputEventListener.h"
+
+namespace orxonox
+{
+  /**
+    @brief standard constructor
+  */
+  InputEventListener::InputEventListener()
+  {
+    RegisterRootObject(InputEventListener);
+    this->bActive_ = true;
+  }
+
+  InputEventListener::~InputEventListener()
+  {
+  }
+
+}
Index: code/branches/network/src/orxonox/InputEventListener.h
===================================================================
--- code/branches/network/src/orxonox/InputEventListener.h	(revision 922)
+++ code/branches/network/src/orxonox/InputEventListener.h	(revision 922)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ @file
+ @brief InputEventListener Interface declaration
+ */
+
+#ifndef _InputEventListener_H__
+#define _InputEventListener_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/OrxonoxClass.h"
+#include "InputEvent.h"
+
+namespace orxonox
+{
+  /**
+    @brief Interface that any class can use to get key independent input.
+  */
+  class _OrxonoxExport InputEventListener : virtual public OrxonoxClass
+  {
+    friend class InputHandler;
+  public:
+    InputEventListener();
+    virtual ~InputEventListener();
+    /** Method is called every time an Input event occurs && bActive */
+    virtual void eventOccured(InputEvent &evt) = 0;
+
+  private:
+    bool bActive_;
+  };
+}
+
+#endif /* _InputEventListener_H__ */
Index: code/branches/network/src/orxonox/InputHandler.cc
===================================================================
--- code/branches/network/src/orxonox/InputHandler.cc	(revision 921)
+++ code/branches/network/src/orxonox/InputHandler.cc	(revision 922)
@@ -36,10 +36,9 @@
 #include "core/CoreIncludes.h"
 #include "Orxonox.h"
+#include "InputEventListener.h"
 #include "InputHandler.h"
 
 namespace orxonox
 {
-  //using namespace OIS;
-
   /**
     @brief Constructor only resets the pointer values to 0.
@@ -47,27 +46,8 @@
   InputHandler::InputHandler()
   {
-    /*if (orxonox::Identifier::isCreatingHierarchy() && !this->getParents())
-        this->createParents();
-    this->setIdentifier(orxonox::ClassManager<InputHandler>::getIdentifier()->registerClass(this->getParents(), "InputHandler", true));
-    if (orxonox::Identifier::isCreatingHierarchy() && this->getParents())
-        this->getParents()->insert(this->getParents()->end(), this->getIdentifier());
-    orxonox::ClassManager<InputHandler>::getIdentifier()->addObject(this);*/
-
     //RegisterObject(InputHandler);
-
     this->mouse_       = 0;
     this->keyboard_    = 0;
     this->inputSystem_ = 0;
-
-    //this->setConfigValues();
-  }
-
-  void InputHandler::setConfigValues()
-  {
-    //SetConfigValue(codeFire_, 4).description("test value");
-
-    ConfigValueContainer *containercodeFire_ = new ConfigValueContainer("asdfblah", "codeFire_", 4);
-    containercodeFire_->getValue(&codeFire_).description("test");
-    //containercodeFire_->
   }
 
@@ -76,5 +56,5 @@
     @return The pointer to the only instance of the InputHandler
   */
-  InputHandler* InputHandler::getSingleton()
+  InputHandler *InputHandler::getSingleton()
   {
     static InputHandler theOnlyInstance;
@@ -83,5 +63,6 @@
 
   /**
-    @brief Creates the OIS::InputMananger, the keyboard and the mouse
+    @brief Creates the OIS::InputMananger, the keyboard and the mouse and
+           assigns the key bindings.
     @param windowHnd The window handle of the render window
     @param windowWidth The width of the render window
@@ -120,4 +101,12 @@
       }
     }
+
+    // load the key bindings
+    InputEvent empty = {0, false, 0, 0, 0};
+    for (int i = 0; i < this->numberOfKeys_; i++)
+      this->bindingsKeyPressed_[i] = empty;
+
+    //assign 'abort' to the escape key
+    this->bindingsKeyPressed_[(int)OIS::KC_ESCAPE].id = 1;
   }
 
@@ -130,12 +119,8 @@
     // capture all the input. That calls the event handlers.
     if (mouse_)
-    {
       mouse_->capture();
-    }
 
     if (keyboard_)
-    {
       keyboard_->capture();
-    }
   }
 
@@ -155,4 +140,19 @@
 
   /**
+    @brief Calls all the objects from classes that derive from InputEventListener.
+    @param evt The input event that occured.
+  */
+  inline void InputHandler::callListeners(orxonox::InputEvent &evt)
+  {
+    for (Iterator<InputEventListener> it = ObjectList<InputEventListener>::start(); it; )
+    {
+      if (it->bActive_)
+        (it++)->eventOccured(evt);
+      else
+        it++;
+    }
+  }
+
+  /**
     @brief Event handler for the keyPressed Event.
     @param e Event information
@@ -160,6 +160,5 @@
   bool InputHandler::keyPressed(const OIS::KeyEvent &e)
   {
-    if (e.key == OIS::KC_ESCAPE)
-      Orxonox::getSingleton()->abortRequest();
+    callListeners(this->bindingsKeyPressed_[(int)e.key]);
     return true;
   }
Index: code/branches/network/src/orxonox/InputHandler.h
===================================================================
--- code/branches/network/src/orxonox/InputHandler.h	(revision 921)
+++ code/branches/network/src/orxonox/InputHandler.h	(revision 922)
@@ -38,15 +38,14 @@
 
 #include "OrxonoxPrereqs.h"
-//#include "core/OrxonoxClass.h"
 #include "core/Tickable.h"
+#include "InputEvent.h"
 
 namespace orxonox
 {
   class _OrxonoxExport InputHandler
-        : public Tickable,
-          public OIS::KeyListener, public OIS::MouseListener
+        : public Tickable, public OIS::KeyListener, public OIS::MouseListener
   {
+    //friend ClassIdentifier<InputHandler>;
   public:
-
     void initialise(size_t windowHnd, int windowWidth, int windowHeight);
     void tick(float dt);
@@ -55,4 +54,14 @@
     OIS::Mouse    *getMouse()    { return this->mouse_   ; }
     OIS::Keyboard *getKeyboard() { return this->keyboard_; }
+
+    static InputHandler* getSingleton();
+
+  private:
+    // don't mess with a Singleton
+    InputHandler ();
+    InputHandler (const InputHandler&) { }
+    ~InputHandler() { }
+
+    void callListeners(InputEvent &evt);
 
     // input events
@@ -63,21 +72,23 @@
 		bool keyReleased  (const OIS::KeyEvent   &arg);
 
-    static InputHandler* getSingleton();
+    OIS::InputManager *inputSystem_;    //!< OIS input manager
+    OIS::Keyboard     *keyboard_;       //!< OIS mouse
+    OIS::Mouse        *mouse_;          //!< OIS keyboard
 
-    void setConfigValues();
+    //! denotes the maximum number of different keys there are in OIS.
+    //! 256 should be ok since the highest number in the enum is 237.
+    static const int numberOfKeys_ = 256;
+    //! Array of input events for every pressed key
+    InputEvent bindingsKeyPressed_[numberOfKeys_];
+    //! Array of input events for every released key
+    InputEvent bindingsKeyReleased_[numberOfKeys_];
 
-  private:
-    // don't mess with a Singleton
-    InputHandler ();
-    InputHandler (const InputHandler&) { }
-    ~InputHandler() { }
-
-    OIS::InputManager *inputSystem_;
-    OIS::Keyboard     *keyboard_;
-    OIS::Mouse        *mouse_;
-
-    // Key bindings
-    int codeFire_;
-    OIS::KeyCode codeMoveForward_;
+    //! denotes the maximum number of different buttons there are in OIS.
+    //! 16 should be ok since the highest number in the enum is 7.
+    static const int numberOfButtons_ = 16;
+    //! Array of input events for every pressed key
+    InputEvent bindingsButtonPressed_[numberOfButtons_];
+    //! Array of input events for every released key
+    InputEvent bindingsButtonReleased_[numberOfButtons_];
 
   };
Index: code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/network/src/orxonox/Orxonox.cc	(revision 921)
+++ code/branches/network/src/orxonox/Orxonox.cc	(revision 922)
@@ -37,5 +37,4 @@
 #include <OgreException.h>
 #include <OgreRoot.h>
-#include <OgreFrameListener.h>
 #include <OgreRenderWindow.h>
 #include <OgreTextureManager.h>
@@ -373,5 +372,8 @@
   }
 
-
+  /**
+    @brief Calls the InputHandler which sets up the input devices.
+    The render window width and height are used to set up the mouse movement.
+  */
   void Orxonox::setupInputSystem()
   {
@@ -379,29 +381,4 @@
     inputHandler_->initialise(ogre_->getWindowHandle(),
           ogre_->getWindowWidth(), ogre_->getWindowHeight());
-
-    /*size_t windowHnd = 0;
-    std::ostringstream windowHndStr;
-    OIS::ParamList pl;
-
-    // fixes auto repeat problem
-    #if defined OIS_LINUX_PLATFORM
-      pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
-    #endif
-
-      Ogre::RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow();
-    win->getCustomAttribute("WINDOW", &windowHnd);
-    windowHndStr << windowHnd;
-    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
-    inputManager_ = OIS::InputManager::createInputSystem(pl);
-
-    try
-    {
-      keyboard_ = static_cast<OIS::Keyboard*>(inputManager_->createInputObject(OIS::OISKeyboard, false));
-      mouse_ = static_cast<OIS::Mouse*>(inputManager_->createInputObject(OIS::OISMouse, true));
-    }
-    catch (const OIS::Exception &e)
-    {
-      throw new Ogre::Exception(42, e.eText, "OrxApplication::setupInputSystem");
-    }*/
   }
 
@@ -512,3 +489,9 @@
     return (float)(times.back() - times.front()) / ((times.size()-1) * 1000);
   }
+
+  void Orxonox::eventOccured(InputEvent &evt)
+  {
+    if (evt.id == 1)
+      this->abortRequest();
+  }
 }
Index: code/branches/network/src/orxonox/Orxonox.h
===================================================================
--- code/branches/network/src/orxonox/Orxonox.h	(revision 921)
+++ code/branches/network/src/orxonox/Orxonox.h	(revision 922)
@@ -18,4 +18,5 @@
 
 #include "GraphicsEngine.h"
+#include "InputEventListener.h"
 
 
@@ -30,5 +31,5 @@
   };
 
-  class _OrxonoxExport Orxonox
+  class _OrxonoxExport Orxonox : public InputEventListener
   {
     public:
@@ -68,4 +69,6 @@
       float calculateEventTime(unsigned long, std::deque<unsigned long>&);
 
+      void eventOccured(InputEvent &evt);
+
     private:
       GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
Index: code/branches/network/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/network/src/orxonox/OrxonoxPrereqs.h	(revision 921)
+++ code/branches/network/src/orxonox/OrxonoxPrereqs.h	(revision 922)
@@ -68,4 +68,6 @@
   class Camera;
   class GraphicsEngine;
+  struct InputEvent;
+  class InputEventListener;
   class InputHandler;
   class Mesh;
Index: code/branches/network/src/orxonox/OrxonoxStableHeaders.h
===================================================================
--- code/branches/network/src/orxonox/OrxonoxStableHeaders.h	(revision 921)
+++ code/branches/network/src/orxonox/OrxonoxStableHeaders.h	(revision 922)
@@ -46,25 +46,35 @@
 #endif
 //#include <Ogre.h>
-//#include <OgreBillboardSet.h>
-//#include <OgreCamera.h>
-//#include <OgreConfigFile.h>
+#include <OgreBillboardSet.h>
+#include <OgreCamera.h>
+#include <OgreColourValue.h>
+#include <OgreConfigFile.h>
 #include <OgreEntity.h>
 #include <OgreException.h>
-//#include <OgreFrameListener.h>
+#include <OgreFrameListener.h>
 #include <OgreLight.h>
-//#include <OgreOverlay.h>
-//#include <OgreOverlayElement.h>
-//#include <OgreOverlayManager.h>
+#include <OgreMath.h>
+#include <OgreMatrix3.h>
+#include <OgreOverlay.h>
+#include <OgreOverlayElement.h>
+#include <OgreOverlayManager.h>
 #include <OgreParticleEmitter.h>
 #include <OgreParticleSystem.h>
 #include <OgrePlatform.h>
 #include <OgrePrerequisites.h>
-//#include <OgreRenderWindow.h>
-//#include <OgreRoot.h>
+#include <OgreQuaternion.h>
+#include <OgreResourceGroupManager.h>
+#include <OgreRenderWindow.h>
+#include <OgreRoot.h>
 #include <OgreSceneManager.h>
 #include <OgreSceneNode.h>
 #include <OgreStringConverter.h>
-//#include <OgreTextureManager.h>
-//#include <OgreViewport.h>
+#include <OgreTextureManager.h>
+#include <OgreTimer.h>
+#include <OgreVector2.h>
+#include <OgreVector3.h>
+#include <OgreVector3.h>
+#include <OgreViewport.h>
+#include <OgreWindowEventUtilities.h>
 
 #include <OIS/OIS.h>
