Index: /code/trunk/CMakeLists.txt
===================================================================
--- /code/trunk/CMakeLists.txt	(revision 1534)
+++ /code/trunk/CMakeLists.txt	(revision 1535)
@@ -67,6 +67,6 @@
 # FIND_PACKAGE(CEGUI_OGRE)
 FIND_PACKAGE(ENet)
-FIND_PACKAGE(Boost REQUIRED thread)
-FIND_PACKAGE(Boost REQUIRED filesystem)
+FIND_PACKAGE(Boost REQUIRED thread filesystem)
+#FIND_PACKAGE(Boost REQUIRED filesystem)
 FIND_PACKAGE(OpenAL)
 FIND_PACKAGE(ALUT)
Index: de/trunk/bin/media.cfg
===================================================================
--- /code/trunk/bin/media.cfg	(revision 1534)
+++ 	(revision )
@@ -1,16 +1,0 @@
-Mesh=ogrehead.mesh
-Mesh=geosphere4500.mesh
-Mesh=razor.mesh
-Mesh=knot.mesh
-Mesh=RZR-002.mesh
-Mesh=geosphere8000.mesh
-Mesh=sphere.mesh
-
-CubeMap=cubescene.jpg
-CubeMap=early_morning.jpg
-CubeMap=cubemap.jpg
-CubeMap=morning.jpg
-CubeMap=cloudy_noon.jpg
-CubeMap=evening.jpg
-CubeMap=stormy.jpg
-CubeMap=stevecube.jpg
Index: de/trunk/bin/quake3settings.cfg
===================================================================
--- /code/trunk/bin/quake3settings.cfg	(revision 1534)
+++ 	(revision )
@@ -1,3 +1,0 @@
-Pak0Location: f:\quake3levels\chiropteraDM.pk3
-Map: maps/chiropteradm.bsp
-
Index: /code/trunk/src/audio/AudioManager.h
===================================================================
--- /code/trunk/src/audio/AudioManager.h	(revision 1534)
+++ /code/trunk/src/audio/AudioManager.h	(revision 1535)
@@ -35,9 +35,7 @@
 #include <string>
 
-#include "core/Tickable.h"
-
 namespace audio
 {
-  class _AudioExport AudioManager : public orxonox::Tickable
+  class _AudioExport AudioManager
 	{
 	public:
Index: /code/trunk/src/core/CMakeLists.txt
===================================================================
--- /code/trunk/src/core/CMakeLists.txt	(revision 1534)
+++ /code/trunk/src/core/CMakeLists.txt	(revision 1535)
@@ -4,5 +4,5 @@
   ConfigFileManager.cc
   ConfigValueContainer.cc
-  CoreSettings.cc
+  Core.cc
   Error.cc
   Executor.cc
@@ -10,8 +10,5 @@
   Identifier.cc
   IdentifierDistributor.cc
-  InputManager.cc
-  KeyBinder.cc
   OutputBuffer.cc
-  InputBuffer.cc
   Shell.cc
   CommandExecutor.cc
@@ -30,8 +27,17 @@
   SignalHandler.cc
   TclBind.cc
-  Tickable.cc
   XMLPort.cc
   TclThreadManager.cc
   IRC.cc
+
+  input/Button.cc
+  input/CalibratorCallback.cc
+  input/HalfAxis.cc
+  input/InputBuffer.cc
+  input/InputCommands.cc
+  input/InputManager.cc
+  input/KeyBinder.cc
+  input/KeyDetector.cc
+
   tolua/tolua_bind.cc
 )
Index: /code/trunk/src/core/Core.cc
===================================================================
--- /code/trunk/src/core/Core.cc	(revision 1535)
+++ /code/trunk/src/core/Core.cc	(revision 1535)
@@ -0,0 +1,209 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Core.cc
+    @brief Implementation of the Core class.
+*/
+
+#include "Core.h"
+#include "Language.h"
+#include "CoreIncludes.h"
+#include "ConfigValueIncludes.h"
+#include "input/InputManager.h"
+#include "TclThreadManager.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor: Registers the object and sets the config-values.
+        @param A reference to a global variable, used to avoid an infinite recursion in getSoftDebugLevel()
+    */
+    Core::Core()
+    {
+        RegisterRootObject(Core);
+        this->setConfigValues();
+    }
+
+    /**
+        @brief Sets the bool to true to avoid static functions accessing a deleted object.
+    */
+    Core::~Core()
+    {
+        isCreatingCoreSettings() = true;
+    }
+
+    /**
+        @brief Returns true if the Core instance is not yet ready and the static functions have to return a default value.
+    */
+    bool& Core::isCreatingCoreSettings()
+    {
+        static bool bCreatingCoreSettings = true;
+        static bool bFirstTime = true;
+        if (bFirstTime)
+        {
+            bFirstTime = false;
+            Core::getInstance();
+        }
+        return bCreatingCoreSettings;
+    }
+
+    /**
+        @brief Returns a unique instance of Core.
+        @return The instance
+    */
+    Core& Core::getInstance()
+    {
+        static Core instance = Core();
+
+        // If bCreatingSoftDebugLevelObject is true, we're just about to create an instance of the DebugLevel class
+        if (Core::isCreatingCoreSettings())
+        {
+            isCreatingCoreSettings() = false;
+            instance.setConfigValues();
+        }
+        return instance;
+    }
+
+    /**
+        @brief Function to collect the SetConfigValue-macro calls.
+    */
+    void Core::setConfigValues()
+    {
+        SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console");
+        SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile");
+        SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell");
+
+        // softDebugLevel_ is the maximum of the 3 variables
+        this->softDebugLevel_ = this->softDebugLevelConsole_;
+        if (this->softDebugLevelLogfile_ > this->softDebugLevel_)
+            this->softDebugLevel_ = this->softDebugLevelLogfile_;
+        if (this->softDebugLevelShell_ > this->softDebugLevel_)
+            this->softDebugLevel_ = this->softDebugLevelShell_;
+
+
+        std::string temp = this->language_;
+        SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text");
+
+        if (this->language_ != temp)
+        {
+            // Read the translation file after the language was configured
+            Language::getLanguage().readTranslatedLanguageFile();
+        }
+    }
+
+    /**
+        @brief Returns the softDebugLevel for the given device (returns a default-value if the class ist right about to be created).
+        @param device The device
+        @return The softDebugLevel
+    */
+    int Core::getSoftDebugLevel(OutputHandler::OutputDevice device)
+    {
+        if (!Core::isCreatingCoreSettings())
+        {
+            if (device == OutputHandler::LD_All)
+                return Core::getInstance().softDebugLevel_;
+            else if (device == OutputHandler::LD_Console)
+                return Core::getInstance().softDebugLevelConsole_;
+            else if (device == OutputHandler::LD_Logfile)
+                return Core::getInstance().softDebugLevelLogfile_;
+            else if (device == OutputHandler::LD_Shell)
+                return Core::getInstance().softDebugLevelShell_;
+        }
+
+        // Return a constant value while we're creating the object
+        return 2;
+    }
+
+     /**
+        @brief Sets the softDebugLevel for the given device. Please use this only temporary and restore the value afterwards, as it overrides the configured value.
+        @param device The device
+        @param level The level
+    */
+     void Core::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
+     {
+        if (!Core::isCreatingCoreSettings())
+        {
+            if (device == OutputHandler::LD_All)
+                Core::getInstance().softDebugLevel_ = level;
+            else if (device == OutputHandler::LD_Console)
+                Core::getInstance().softDebugLevelConsole_ = level;
+            else if (device == OutputHandler::LD_Logfile)
+                Core::getInstance().softDebugLevelLogfile_ = level;
+            else if (device == OutputHandler::LD_Shell)
+                Core::getInstance().softDebugLevelShell_ = level;
+        }
+     }
+
+    /**
+        @brief Returns the configured language.
+    */
+    const std::string& Core::getLanguage()
+    {
+        if (!Core::isCreatingCoreSettings())
+            return Core::getInstance().language_;
+
+        return Language::getLanguage().defaultLanguage_;
+    }
+
+    /**
+        @brief Sets the language in the config-file back to the default.
+    */
+    void Core::resetLanguage()
+    {
+        Core::getInstance().resetLanguageIntern();
+    }
+
+    /**
+        @brief Sets the language in the config-file back to the default.
+    */
+    void Core::resetLanguageIntern()
+    {
+        ResetConfigValue(language_);
+    }
+
+    /**
+        @brief Ticks every core class in a specified sequence. Has to be called
+               every Orxonox tick!
+        @param dt Delta Time
+    */
+    void Core::tick(float dt)
+    {
+        TclThreadManager::getInstance().tick(dt);
+        InputManager::tick(dt);
+    }
+}
+
+/**
+    @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
+    @return The soft debug level
+*/
+int getSoftDebugLevel()
+{
+    return orxonox::Core::getSoftDebugLevel();
+}
Index: /code/trunk/src/core/Core.h
===================================================================
--- /code/trunk/src/core/Core.h	(revision 1535)
+++ /code/trunk/src/core/Core.h	(revision 1535)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Core.h
+    @brief Definition of the Core class.
+
+    The Core class is a singleton, only used to configure some variables
+    in the core through the config-file.
+*/
+
+#ifndef _Core_H__
+#define _Core_H__
+
+#include "CorePrereqs.h"
+
+#include "OrxonoxClass.h"
+#include "OutputHandler.h"
+
+namespace orxonox
+{
+    //! The Core class is a singleton, only used to configure some config-values.
+    class _CoreExport Core : public OrxonoxClass
+    {
+        public:
+            static Core& getInstance();
+            static bool& isCreatingCoreSettings();
+            void setConfigValues();
+
+            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
+            static void setSoftDebugLevel(OutputHandler::OutputDevice device, int level);
+            static const std::string& getLanguage();
+            static void resetLanguage();
+
+            static void tick(float dt);
+
+        private:
+            void resetLanguageIntern();
+
+            Core();
+            Core(const Core& other);
+            virtual ~Core();
+
+            int softDebugLevel_;                            //!< The debug level
+            int softDebugLevelConsole_;                     //!< The debug level for the console
+            int softDebugLevelLogfile_;                     //!< The debug level for the logfile
+            int softDebugLevelShell_;                       //!< The debug level for the ingame shell
+            std::string language_;                          //!< The language
+    };
+}
+
+#endif /* _Core_H__ */
Index: /code/trunk/src/core/CorePrereqs.h
===================================================================
--- /code/trunk/src/core/CorePrereqs.h	(revision 1534)
+++ /code/trunk/src/core/CorePrereqs.h	(revision 1535)
@@ -112,5 +112,5 @@
   class ConfigValueContainer;
   class ConsoleCommand;
-  class CoreSettings;
+  class Core;
   class Error;
   class Executor;
@@ -162,14 +162,18 @@
   // input
   //class GUIInputHandler;
-  class Calibrator;
+  class BaseCommand;
+  class BufferedParamCommand;
+  class Button;
   class CalibratorCallback;
+  class HalfAxis;
   class InputBuffer;
-  class InputBufferListener;
   class InputManager;
   class JoyStickHandler;
+  class MouseHandler;
   class KeyBinder;
   class KeyDetector;
-  class MouseHandler;
-
+  class KeyHandler;
+  class ParamCommand;
+  class SimpleCommand;
 }
 
Index: de/trunk/src/core/CoreSettings.cc
===================================================================
--- /code/trunk/src/core/CoreSettings.cc	(revision 1534)
+++ 	(revision )
@@ -1,196 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file CoreSettings.cc
-    @brief Implementation of the CoreSettings class.
-*/
-
-#include "CoreSettings.h"
-#include "Language.h"
-#include "CoreIncludes.h"
-#include "ConfigValueIncludes.h"
-
-namespace orxonox
-{
-    /**
-        @brief Constructor: Registers the object and sets the config-values.
-        @param A reference to a global variable, used to avoid an infinite recursion in getSoftDebugLevel()
-    */
-    CoreSettings::CoreSettings()
-    {
-        RegisterRootObject(CoreSettings);
-        this->setConfigValues();
-    }
-
-    /**
-        @brief Sets the bool to true to avoid static functions accessing a deleted object.
-    */
-    CoreSettings::~CoreSettings()
-    {
-        isCreatingCoreSettings() = true;
-    }
-
-    /**
-        @brief Returns true if the CoreSettings instance is not yet ready and the static functions have to return a default value.
-    */
-    bool& CoreSettings::isCreatingCoreSettings()
-    {
-        static bool bCreatingCoreSettings = true;
-        static bool bFirstTime = true;
-        if (bFirstTime)
-        {
-            bFirstTime = false;
-            CoreSettings::getInstance();
-        }
-        return bCreatingCoreSettings;
-    }
-
-    /**
-        @brief Returns a unique instance of CoreSettings.
-        @return The instance
-    */
-    CoreSettings& CoreSettings::getInstance()
-    {
-        static CoreSettings instance = CoreSettings();
-
-        // If bCreatingSoftDebugLevelObject is true, we're just about to create an instance of the DebugLevel class
-        if (CoreSettings::isCreatingCoreSettings())
-        {
-            isCreatingCoreSettings() = false;
-            instance.setConfigValues();
-        }
-        return instance;
-    }
-
-    /**
-        @brief Function to collect the SetConfigValue-macro calls.
-    */
-    void CoreSettings::setConfigValues()
-    {
-        SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console");
-        SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile");
-        SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell");
-
-        // softDebugLevel_ is the maximum of the 3 variables
-        this->softDebugLevel_ = this->softDebugLevelConsole_;
-        if (this->softDebugLevelLogfile_ > this->softDebugLevel_)
-            this->softDebugLevel_ = this->softDebugLevelLogfile_;
-        if (this->softDebugLevelShell_ > this->softDebugLevel_)
-            this->softDebugLevel_ = this->softDebugLevelShell_;
-
-
-        std::string temp = this->language_;
-        SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text");
-
-        if (this->language_ != temp)
-        {
-            // Read the translation file after the language was configured
-            Language::getLanguage().readTranslatedLanguageFile();
-        }
-    }
-
-    /**
-        @brief Returns the softDebugLevel for the given device (returns a default-value if the class ist right about to be created).
-        @param device The device
-        @return The softDebugLevel
-    */
-    int CoreSettings::getSoftDebugLevel(OutputHandler::OutputDevice device)
-    {
-        if (!CoreSettings::isCreatingCoreSettings())
-        {
-            if (device == OutputHandler::LD_All)
-                return CoreSettings::getInstance().softDebugLevel_;
-            else if (device == OutputHandler::LD_Console)
-                return CoreSettings::getInstance().softDebugLevelConsole_;
-            else if (device == OutputHandler::LD_Logfile)
-                return CoreSettings::getInstance().softDebugLevelLogfile_;
-            else if (device == OutputHandler::LD_Shell)
-                return CoreSettings::getInstance().softDebugLevelShell_;
-        }
-
-        // Return a constant value while we're creating the object
-        return 2;
-    }
-
-     /**
-        @brief Sets the softDebugLevel for the given device. Please use this only temporary and restore the value afterwards, as it overrides the configured value.
-        @param device The device
-        @param level The level
-    */
-     void CoreSettings::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
-     {
-        if (!CoreSettings::isCreatingCoreSettings())
-        {
-            if (device == OutputHandler::LD_All)
-                CoreSettings::getInstance().softDebugLevel_ = level;
-            else if (device == OutputHandler::LD_Console)
-                CoreSettings::getInstance().softDebugLevelConsole_ = level;
-            else if (device == OutputHandler::LD_Logfile)
-                CoreSettings::getInstance().softDebugLevelLogfile_ = level;
-            else if (device == OutputHandler::LD_Shell)
-                CoreSettings::getInstance().softDebugLevelShell_ = level;
-        }
-     }
-
-    /**
-        @brief Returns the configured language.
-    */
-    const std::string& CoreSettings::getLanguage()
-    {
-        if (!CoreSettings::isCreatingCoreSettings())
-            return CoreSettings::getInstance().language_;
-
-        return Language::getLanguage().defaultLanguage_;
-    }
-
-    /**
-        @brief Sets the language in the config-file back to the default.
-    */
-    void CoreSettings::resetLanguage()
-    {
-        CoreSettings::getInstance().resetLanguageIntern();
-    }
-
-    /**
-        @brief Sets the language in the config-file back to the default.
-    */
-    void CoreSettings::resetLanguageIntern()
-    {
-        ResetConfigValue(language_);
-    }
-}
-
-/**
-    @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
-    @return The soft debug level
-*/
-int getSoftDebugLevel()
-{
-    return orxonox::CoreSettings::getSoftDebugLevel();
-}
Index: de/trunk/src/core/CoreSettings.h
===================================================================
--- /code/trunk/src/core/CoreSettings.h	(revision 1534)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file CoreSettings.h
-    @brief Definition of the CoreSettings class.
-
-    The CoreSettings class is a singleton, only used to configure some variables
-    in the core through the config-file.
-*/
-
-#ifndef _CoreSettings_H__
-#define _CoreSettings_H__
-
-#include "CorePrereqs.h"
-
-#include "OrxonoxClass.h"
-#include "OutputHandler.h"
-
-namespace orxonox
-{
-    //! The CoreSettings class is a singleton, only used to configure some config-values.
-    class _CoreExport CoreSettings : public OrxonoxClass
-    {
-        public:
-            static CoreSettings& getInstance();
-            static bool& isCreatingCoreSettings();
-            void setConfigValues();
-
-            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
-            static void setSoftDebugLevel(OutputHandler::OutputDevice device, int level);
-            static const std::string& getLanguage();
-            static void resetLanguage();
-
-        private:
-            void resetLanguageIntern();
-
-            CoreSettings();
-            CoreSettings(const CoreSettings& other);
-            virtual ~CoreSettings();
-
-            int softDebugLevel_;                            //!< The debug level
-            int softDebugLevelConsole_;                     //!< The debug level for the console
-            int softDebugLevelLogfile_;                     //!< The debug level for the logfile
-            int softDebugLevelShell_;                       //!< The debug level for the ingame shell
-            std::string language_;                          //!< The language
-    };
-}
-
-#endif /* _CoreSettings_H__ */
Index: de/trunk/src/core/InputBuffer.cc
===================================================================
--- /code/trunk/src/core/InputBuffer.cc	(revision 1534)
+++ 	(revision )
@@ -1,257 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      Reto Grieder
- *
- */
-
-#include "InputBuffer.h"
-
-#include <iostream>
-
-#include "util/Clipboard.h"
-#include "CoreIncludes.h"
-#include "ConfigValueIncludes.h"
-
-namespace orxonox
-{
-    InputBuffer::InputBuffer()
-    {
-        RegisterObject(InputBuffer);
-
-        this->buffer_ = "";
-        this->cursor_ = 0;
-        this->allowedChars_ = "abcdefghijklmnopqrstuvwxyz \
-                               ABCDEFGHIJKLMNOPQRSTUVWXYZ \
-                               äëïöüÄËÏÖÜáâàéêèíîìóôòúûù \
-                               0123456789 \
-                               \\\"(){}[]<>.:,;_-+*/=!?|$&%^~#";
-
-        this->lastKey_ = KeyCode::Unassigned;
-        this->timeSinceKeyPressed_ = 0.0f;
-        this->timeSinceKeyRepeated_ = 0.0f;
-        this->keysToRepeat_ = 0;
-
-        setConfigValues();
-    }
-
-    InputBuffer::InputBuffer(const std::string allowedChars)
-    {
-        RegisterObject(InputBuffer);
-
-        this->allowedChars_ = allowedChars;
-        this->buffer_ = "";
-        this->cursor_ = 0;
-
-        this->lastKey_ = KeyCode::Unassigned;
-        this->timeSinceKeyPressed_ = 0.0f;
-        this->timeSinceKeyRepeated_ = 0.0f;
-        this->keysToRepeat_ = 0;
-
-        setConfigValues();
-    }
-
-    void InputBuffer::setConfigValues()
-    {
-        SetConfigValue(keyRepeatDeleay_, 0.4).description("Key repeat deleay of the input buffer");
-        SetConfigValue(keyRepeatTime_, 0.022).description("Key repeat time of the input buffer");
-
-        if (keyRepeatDeleay_ < 0.0)
-        {
-            ResetConfigValue(keyRepeatDeleay_);
-        }
-        if (keyRepeatTime_ < 0.0)
-        {
-            ResetConfigValue(keyRepeatTime_);
-        }
-    }
-
-    void InputBuffer::set(const std::string& input, bool update)
-    {
-        this->clear(false);
-        this->insert(input, update);
-    }
-
-    void InputBuffer::insert(const std::string& input, bool update)
-    {
-        for (unsigned int i = 0; i < input.size(); ++i)
-        {
-            this->insert(input[i], false);
-
-            if (update)
-                this->updated(input[i], false);
-        }
-
-        if (update)
-            this->updated();
-    }
-
-    void InputBuffer::insert(const char& input, bool update)
-    {
-        if (this->charIsAllowed(input))
-        {
-            this->buffer_.insert(this->cursor_, 1, input);
-            ++this->cursor_;
-        }
-
-        if (update)
-            this->updated(input, true);
-    }
-
-    void InputBuffer::clear(bool update)
-    {
-        this->buffer_ = "";
-        this->cursor_ = 0;
-
-        if (update)
-            this->updated();
-    }
-
-    void InputBuffer::removeBehindCursor(bool update)
-    {
-        if (this->cursor_ > 0)
-        {
-            --this->cursor_;
-            this->buffer_.erase(this->cursor_, 1);
-
-            if (update)
-                this->updated();
-        }
-    }
-
-    void InputBuffer::removeAtCursor(bool update)
-    {
-        if (this->cursor_ < this->buffer_.size())
-        {
-            this->buffer_.erase(this->cursor_, 1);
-
-            if (update)
-                this->updated();
-        }
-    }
-
-    void InputBuffer::updated()
-    {
-        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
-        {
-            if ((*it)->bListenToAllChanges_)
-                (*it)->callFunction();
-        }
-    }
-
-    void InputBuffer::updated(const char& update, bool bSingleInput)
-    {
-        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
-        {
-            if ((!(*it)->trueKeyFalseChar_) && ((*it)->bListenToAllChanges_ || ((*it)->char_ == update)) && (!(*it)->bOnlySingleInput_ || bSingleInput))
-                (*it)->callFunction();
-        }
-    }
-
-    bool InputBuffer::charIsAllowed(const char& input)
-    {
-        if (this->allowedChars_ == "")
-            return true;
-        else
-            return (this->allowedChars_.find(input) != std::string::npos);
-    }
-
-
-    void InputBuffer::processKey(const KeyEvent &evt)
-    {
-        if (evt.isModifierDown(KeyboardModifier::Alt) && evt.key == KeyCode::Tab)
-            return;
-
-        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
-        {
-            if ((*it)->trueKeyFalseChar_ && ((*it)->key_ == evt.key))
-                (*it)->callFunction();
-        }
-
-        if (evt.isModifierDown(KeyboardModifier::Ctrl))
-        {
-            if (evt.key == KeyCode::V)
-                this->insert(fromClipboard());
-            else if (evt.key == KeyCode::C)
-                toClipboard(this->buffer_);
-            else if (evt.key == KeyCode::X)
-            {
-                toClipboard(this->buffer_);
-                this->clear();
-            }
-        }
-        else if (evt.isModifierDown(KeyboardModifier::Shift))
-        {
-            if (evt.key == KeyCode::Insert)
-                this->insert(fromClipboard());
-            else if (evt.key == KeyCode::Delete)
-            {
-                toClipboard(this->buffer_);
-                this->clear();
-            }
-        }
-
-        this->insert((char)evt.text);
-    }
-
-    /**
-        @brief This tick() function is called by the InputManager if the InputBuffer is active.
-        @param dt Delta time
-    */
-    void InputBuffer::tickInput(float dt, const HandlerState& state)
-    {
-        timeSinceKeyPressed_ += dt;
-        if (keysToRepeat_ < 10 && timeSinceKeyPressed_ > keyRepeatDeleay_)
-        {
-            // initial time out has gone by, start repeating keys
-            while (timeSinceKeyPressed_ - timeSinceKeyRepeated_ > keyRepeatTime_)
-            {
-                timeSinceKeyRepeated_ += keyRepeatTime_;
-                keysToRepeat_++;
-            }
-        }
-    }
-
-    void InputBuffer::keyPressed(const KeyEvent &evt)
-    {
-        lastKey_ = evt.key;
-        timeSinceKeyPressed_ = 0.0;
-        timeSinceKeyRepeated_ = keyRepeatDeleay_;
-        keysToRepeat_ = 0;
-
-        processKey(evt);
-    }
-
-    void InputBuffer::keyHeld(const KeyEvent& evt)
-    {
-        if (evt.key == lastKey_)
-        {
-            while (keysToRepeat_)
-            {
-                processKey(evt);
-                keysToRepeat_--;
-            }
-        }
-    }
-}
Index: de/trunk/src/core/InputBuffer.h
===================================================================
--- /code/trunk/src/core/InputBuffer.h	(revision 1534)
+++ 	(revision )
@@ -1,189 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      Reto Grieder
- *
- */
-
-#ifndef _InputBuffer_H__
-#define _InputBuffer_H__
-
-#include "CorePrereqs.h"
-
-#include <string>
-#include <list>
-
-#include "InputInterfaces.h"
-#include "OrxonoxClass.h"
-
-namespace orxonox
-{
-    class BaseInputBufferListenerTuple
-    {
-    public:
-        BaseInputBufferListenerTuple(bool bListenToAllChanges, bool bOnlySingleInput,
-            bool trueKeyFalseChar, char _char, KeyCode::Enum key)
-            : bListenToAllChanges_(bListenToAllChanges), bOnlySingleInput_(bOnlySingleInput),
-              trueKeyFalseChar_(trueKeyFalseChar), char_(_char), key_(key)
-        { }
-        virtual ~BaseInputBufferListenerTuple() { }
-        virtual void callFunction() = 0;
-        bool bListenToAllChanges_;
-        bool bOnlySingleInput_;
-        bool trueKeyFalseChar_;
-        char char_;
-        KeyCode::Enum key_;
-    };
-
-    template <class T>
-    class InputBufferListenerTuple : public BaseInputBufferListenerTuple
-    {
-    public:
-        InputBufferListenerTuple(T* listener, void (T::*function)(), bool bListenToAllChanges,
-            bool bOnlySingleInput, bool trueKeyFalseChar, char _char, KeyCode::Enum key)
-            : BaseInputBufferListenerTuple(bListenToAllChanges, bOnlySingleInput, trueKeyFalseChar, _char, key),
-              listener_(listener), function_(function)
-        { }
-        virtual ~InputBufferListenerTuple() { }
-        void callFunction()
-        {
-            (listener_->*function_)();
-        }
-        T* listener_;
-        void (T::*function_)();
-    };
-
-    class _CoreExport InputBuffer : public KeyHandler, public OrxonoxClass
-    {
-        public:
-            InputBuffer();
-            InputBuffer(const std::string allowedChars);
-
-            void setConfigValues();
-
-            template <class T>
-            void registerListener(T* listener, void (T::*function)(), bool bOnlySingleInput)
-            {
-                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);
-                this->listeners_.insert(this->listeners_.end(), newTuple);
-            }
-            template <class T>
-            void registerListener(T* listener, void (T::*function)() const, bool bOnlySingleInput)
-            {
-                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);
-                this->listeners_.insert(this->listeners_.end(), newTuple);
-            }
-            template <class T>
-            void registerListener(T* listener, void (T::*function)(), char _char, bool bOnlySingleInput)
-            {
-                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);
-                this->listeners_.insert(this->listeners_.end(), newTuple);
-            }
-            template <class T>
-            void registerListener(T* listener, void (T::*function)() const, char _char, bool bOnlySingleInput)
-            {
-                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);
-                this->listeners_.insert(this->listeners_.end(), newTuple);
-            }
-
-            template <class T>
-            void registerListener(T* listener, void (T::*function)(), KeyCode::Enum key)
-            {
-                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);
-                this->listeners_.insert(this->listeners_.end(), newTuple);
-            }
-            template <class T>
-            void registerListener(T* listener, void (T::*function)() const, KeyCode::Enum key)
-            {
-                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);
-                this->listeners_.insert(this->listeners_.end(), newTuple);
-            }
-
-            template <class T>
-            void unregisterListener(T* listener)
-            {
-                for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
-                {
-                    InputBufferListenerTuple<T>* refListener = dynamic_cast<InputBufferListenerTuple<T>*>(*it);
-                    if (refListener && refListener->listener_ == listener)
-                        this->listeners_.erase(it++);
-                    else
-                        it++;
-                }
-            }
-
-            void set(const std::string& input, bool update = true);
-            void insert(const std::string& input, bool update = true);
-            void insert(const char& input, bool update = true);
-            void clear(bool update = true);
-            void removeAtCursor(bool update = true);
-            void removeBehindCursor(bool update = true);
-
-            void updated();
-            void updated(const char& update, bool bSingleInput);
-
-            inline std::string get() const
-                { return this->buffer_; }
-            inline unsigned int getSize() const
-                { return this->buffer_.size(); }
-
-            inline unsigned int getCursorPosition() const
-                { return this->cursor_; }
-            inline void setCursorPosition(unsigned int cursor)
-                { if (cursor <= this->buffer_.size()) { this->cursor_ = cursor; } }
-            inline void setCursorToEnd()
-                { this->cursor_ = this->buffer_.size(); }
-            inline void setCursorToBegin()
-                { this->cursor_ = 0; }
-            inline void increaseCursor()
-                { if (this->cursor_ < this->buffer_.size()) { ++this->cursor_; } }
-            inline void decreaseCursor()
-                { if (this->cursor_ > 0) { --this->cursor_; } }
-
-        private:
-            bool charIsAllowed(const char& input);
-
-            void keyPressed (const KeyEvent& evt);
-            void keyReleased(const KeyEvent& evt) { }
-            void keyHeld    (const KeyEvent& evt);
-            void processKey (const KeyEvent &e);
-
-            void tickInput(float dt, const HandlerState& state);
-
-            std::string buffer_;
-            std::list<BaseInputBufferListenerTuple*> listeners_;
-            std::string allowedChars_;
-            unsigned int cursor_;
-
-            KeyCode::Enum lastKey_;
-            float timeSinceKeyPressed_;
-            float timeSinceKeyRepeated_;
-            int keysToRepeat_;
-
-            float keyRepeatDeleay_;
-            float keyRepeatTime_;
-    };
-}
-
-#endif /* _InputBuffer_H__ */
Index: de/trunk/src/core/InputInterfaces.h
===================================================================
--- /code/trunk/src/core/InputInterfaces.h	(revision 1534)
+++ 	(revision )
@@ -1,322 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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 Declarations of various interface classes for the input management.
-*/
-
-#ifndef _InputInterfaces_H__
-#define _InputInterfaces_H__
-
-#include "CorePrereqs.h"
-
-#include "ois/OIS.h"
-#include "util/Math.h"
-
-namespace orxonox
-{
-  namespace KeyCode
-  {
-    // note: KeyCode comments were directly taken from OISKeyboard.h
-    enum Enum
-    {
-      Unassigned    = OIS::KC_UNASSIGNED,  
-      Escape        = OIS::KC_ESCAPE,      
-      NumRow1       = OIS::KC_1,           
-      NumRow2       = OIS::KC_2,           
-      NumRow3       = OIS::KC_3,           
-      NumRow4       = OIS::KC_4,           
-      NumRow5       = OIS::KC_5,           
-      NumRow6       = OIS::KC_6,           
-      NumRow7       = OIS::KC_7,           
-      NumRow8       = OIS::KC_8,           
-      NumRow9       = OIS::KC_9,           
-      NumRow0       = OIS::KC_0,           
-      Minus         = OIS::KC_MINUS,           // - on main keyboard
-      Equals        = OIS::KC_EQUALS,      
-      Back          = OIS::KC_BACK,            // backspace
-      Tab           = OIS::KC_TAB,         
-      Q             = OIS::KC_Q,           
-      W             = OIS::KC_W,           
-      E             = OIS::KC_E,           
-      R             = OIS::KC_R,           
-      T             = OIS::KC_T,           
-      Y             = OIS::KC_Y,           
-      U             = OIS::KC_U,           
-      I             = OIS::KC_I,           
-      O             = OIS::KC_O,           
-      P             = OIS::KC_P,           
-      LeftBracket   = OIS::KC_LBRACKET,    
-      RightBracket  = OIS::KC_RBRACKET,    
-      Return        = OIS::KC_RETURN,          // Enter on main keyboard
-      LeftControl   = OIS::KC_LCONTROL,    
-      A             = OIS::KC_A,           
-      S             = OIS::KC_S,           
-      D             = OIS::KC_D,           
-      F             = OIS::KC_F,           
-      G             = OIS::KC_G,           
-      H             = OIS::KC_H,           
-      J             = OIS::KC_J,           
-      K             = OIS::KC_K,           
-      L             = OIS::KC_L,           
-      Semicolon     = OIS::KC_SEMICOLON,   
-      Apostrophe    = OIS::KC_APOSTROPHE,  
-      Grave         = OIS::KC_GRAVE,           // accent
-      LeftShift     = OIS::KC_LSHIFT,      
-      Backslash     = OIS::KC_BACKSLASH,   
-      Z             = OIS::KC_Z,           
-      X             = OIS::KC_X,           
-      C             = OIS::KC_C,           
-      V             = OIS::KC_V,           
-      B             = OIS::KC_B,           
-      N             = OIS::KC_N,           
-      M             = OIS::KC_M,           
-      Comma         = OIS::KC_COMMA,       
-      Period        = OIS::KC_PERIOD,          // . on main keyboard
-      Slash         = OIS::KC_SLASH,           // / on main keyboard
-      RightShift    = OIS::KC_RSHIFT,      
-      Multiply      = OIS::KC_MULTIPLY,        // * on numeric keypad
-      LeftAlt       = OIS::KC_LMENU,           // left Alt
-      Space         = OIS::KC_SPACE,       
-      CapsLock      = OIS::KC_CAPITAL,     
-      F1            = OIS::KC_F1,          
-      F2            = OIS::KC_F2,          
-      F3            = OIS::KC_F3,          
-      F4            = OIS::KC_F4,          
-      F5            = OIS::KC_F5,          
-      F6            = OIS::KC_F6,          
-      F7            = OIS::KC_F7,          
-      F8            = OIS::KC_F8,          
-      F9            = OIS::KC_F9,          
-      F10           = OIS::KC_F10,         
-      Numlock       = OIS::KC_NUMLOCK,     
-      Scrolllock    = OIS::KC_SCROLL,          // Scroll Lock
-      Numpad7       = OIS::KC_NUMPAD7,     
-      Numpad8       = OIS::KC_NUMPAD8,     
-      Numpad9       = OIS::KC_NUMPAD9,     
-      NumpadSubtract= OIS::KC_SUBTRACT,        // - on numeric keypad
-      Numpad4       = OIS::KC_NUMPAD4,     
-      Numpad5       = OIS::KC_NUMPAD5,     
-      Numpad6       = OIS::KC_NUMPAD6,     
-      NumpadAdd     = OIS::KC_ADD,             // + on numeric keypad
-      Numpad1       = OIS::KC_NUMPAD1,     
-      Numpad2       = OIS::KC_NUMPAD2,     
-      Numpad3       = OIS::KC_NUMPAD3,     
-      Numpad0       = OIS::KC_NUMPAD0,     
-      NumpadPeriod  = OIS::KC_DECIMAL,         // . on numeric keypad
-      LessThan      = OIS::KC_OEM_102,         // < > | on UK/Germany keyboards
-      F11           = OIS::KC_F11,         
-      F12           = OIS::KC_F12,         
-      F13           = OIS::KC_F13,             //                     (NEC PC98)
-      F14           = OIS::KC_F14,             //                     (NEC PC98)
-      F15           = OIS::KC_F15,             //                     (NEC PC98)
-      Kana          = OIS::KC_KANA,            // (Japanese keyboard)
-      ABNT_C1       = OIS::KC_ABNT_C1,         // / ? on Portugese (Brazilian) keyboards
-      Convert       = OIS::KC_CONVERT,         // (Japanese keyboard)
-      NoConvert     = OIS::KC_NOCONVERT,       // (Japanese keyboard)
-      Yen           = OIS::KC_YEN,             // (Japanese keyboard)
-      ABNT_C2       = OIS::KC_ABNT_C2,         // Numpad . on Portugese (Brazilian) keyboards
-      NumpadEquals  = OIS::KC_NUMPADEQUALS,    // = on numeric keypad (NEC PC98)
-      PreviousTrack = OIS::KC_PREVTRACK,       // Previous Track (KC_CIRCUMFLEX on Japanese keyboard)
-      AT            = OIS::KC_AT,              //                     (NEC PC98)
-      Colon         = OIS::KC_COLON,           //                     (NEC PC98)
-      Underline     = OIS::KC_UNDERLINE,       //                     (NEC PC98)
-      Kanji         = OIS::KC_KANJI,           // (Japanese keyboard)
-      Stop          = OIS::KC_STOP,            //                     (NEC PC98)
-      AX            = OIS::KC_AX,              //                     (Japan AX)
-      Unlabeled     = OIS::KC_UNLABELED,       //                        (J3100)
-      NextTrack     = OIS::KC_NEXTTRACK,       // Next Track
-      NumpadEnter   = OIS::KC_NUMPADENTER,     // Enter on numeric keypad
-      RightControl  = OIS::KC_RCONTROL,    
-      Mute          = OIS::KC_MUTE,            // Mute
-      Calculator    = OIS::KC_CALCULATOR,      // Calculator
-      PlayPause     = OIS::KC_PLAYPAUSE,       // Play / Pause
-      MediaStop     = OIS::KC_MEDIASTOP,       // Media Stop
-      VolumeDown    = OIS::KC_VOLUMEDOWN,      // Volume -
-      VolumeUp      = OIS::KC_VOLUMEUP,        // Volume +
-      WebHome       = OIS::KC_WEBHOME,         // Web home
-      NumpadComma   = OIS::KC_NUMPADCOMMA,     // , on numeric keypad (NEC PC98)
-      Divide        = OIS::KC_DIVIDE,          // / on numeric keypad
-      SYSRQ         = OIS::KC_SYSRQ,       
-      RightAlt      = OIS::KC_RMENU,           // right Alt
-      Pause         = OIS::KC_PAUSE,           // Pause
-      Home          = OIS::KC_HOME,            // Home on arrow keypad
-      Up            = OIS::KC_UP,              // UpArrow on arrow keypad
-      PageUp        = OIS::KC_PGUP,            // PgUp on arrow keypad
-      Left          = OIS::KC_LEFT,            // LeftArrow on arrow keypad
-      Right         = OIS::KC_RIGHT,           // RightArrow on arrow keypad
-      End           = OIS::KC_END,             // End on arrow keypad
-      Down          = OIS::KC_DOWN,            // DownArrow on arrow keypad
-      PageDown      = OIS::KC_PGDOWN,          // PgDn on arrow keypad
-      Insert        = OIS::KC_INSERT,          // Insert on arrow keypad
-      Delete        = OIS::KC_DELETE,          // Delete on arrow keypad
-      LeftWindows   = OIS::KC_LWIN,            // Left Windows key
-      RightWindows  = OIS::KC_RWIN,            // Right Windows key
-      Apps          = OIS::KC_APPS,            // AppMenu key
-      Power         = OIS::KC_POWER,           // System Power
-      Sleep         = OIS::KC_SLEEP,           // System Sleep
-      Wake          = OIS::KC_WAKE,            // System Wake
-      WebSearch     = OIS::KC_WEBSEARCH,       // Web Search
-      WebFavorites  = OIS::KC_WEBFAVORITES,    // Web Favorites
-      WebRefresh    = OIS::KC_WEBREFRESH,      // Web Refresh
-      WebStop       = OIS::KC_WEBSTOP,         // Web Stop
-      WebForward    = OIS::KC_WEBFORWARD,      // Web Forward
-      WebBack       = OIS::KC_WEBBACK,         // Web Back
-      MyComputer    = OIS::KC_MYCOMPUTER,      // My Computer
-      Mail          = OIS::KC_MAIL,            // Mail
-      MediaSelect   = OIS::KC_MEDIASELECT      // Media Select
-    };
-  }
-
-  namespace MouseButton
-  {
-    enum Enum
-    {
-      Left    = OIS::MB_Left,
-      Right   = OIS::MB_Right,
-      Middle  = OIS::MB_Middle,
-      Button3 = OIS::MB_Button3,
-      Button4 = OIS::MB_Button4,
-      Button5 = OIS::MB_Button5,
-      Button6 = OIS::MB_Button6,
-      Button7 = OIS::MB_Button7
-    };
-  }
-
-  namespace KeyboardModifier
-  {
-    enum Enum
-    {
-      Shift = 0x0000001,
-      Ctrl  = 0x0000010,
-      Alt   = 0x0000100
-    };
-  }
-
-  struct _CoreExport Key
-  {
-    Key(const OIS::KeyEvent& evt) : key((KeyCode::Enum)evt.key), text(evt.text) { }
-    KeyCode::Enum key;
-    unsigned int text;
-  };
-
-  class _CoreExport KeyEvent
-  {
-  public:
-    KeyEvent(KeyCode::Enum key, unsigned int text) : key(key), text(text) { }
-    KeyEvent(const OIS::KeyEvent& evt, unsigned int mod) : key((KeyCode::Enum)evt.key), text(evt.text), modifiers(mod) { }
-    KeyEvent(const Key& key, unsigned int mod) : key(key.key), text(key.text), modifiers(mod) { }
-    bool isModifierDown(KeyboardModifier::Enum modifier) const { return (KeyboardModifier::Enum)modifier&modifiers; }
-
-    const KeyCode::Enum key;
-    unsigned int text;
-    unsigned int modifiers;
-  };
-
-  //typedef OIS::MouseState MouseState;
-
-  /*class _CoreExport JoyStickState
-  {
-  public:
-    JoyStickState(const OIS::JoyStickState& state, int ID) : OIS::JoyStickState(state), mJoyStickID(ID) { }
-    JoyStickState() { clear(); }
-    int mJoyStickID;
-		JoyStickState() { clear(); }
-
-		std::vector<bool> mButtons;
-		int axes[16];
-		std::vector<Vector3> mVectors;
-  };*/
-  
-  /**
-  * Helper struct to determine which handlers of an object (can implement
-  * multiple handlers) are active.
-  */
-  struct HandlerState
-  {
-    HandlerState() : key(false), mouse(false), joyStick(false) { }
-    bool key;
-    bool mouse;
-    bool joyStick;
-  };
-
-  class _CoreExport InputTickable
-  {
-  public:
-    virtual ~InputTickable() { }
-    virtual void tickInput(float dt, const HandlerState& state) = 0;
-  };
-
-  /**
-    @brief Interface class used for key input listeners.
-  */
-  class _CoreExport KeyHandler : virtual public InputTickable
-  {
-  public:
-    virtual ~KeyHandler() { }
-    virtual void keyPressed (const KeyEvent& evt) = 0;
-    virtual void keyReleased(const KeyEvent& evt) = 0;
-    virtual void keyHeld    (const KeyEvent& evt) = 0;
-    //virtual void tickKey    (float dt) { }
-  };
-
-  /**
-    @brief Interface class used for mouse input listeners.
-  */
-  class _CoreExport MouseHandler : virtual public InputTickable
-  {
-  public:
-    virtual ~MouseHandler() { }
-    virtual void mouseButtonPressed (MouseButton::Enum id) = 0;
-    virtual void mouseButtonReleased(MouseButton::Enum id) = 0;
-    virtual void mouseButtonHeld    (MouseButton::Enum id) = 0;
-    virtual void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) = 0;
-    virtual void mouseScrolled      (int abs, int rel)     = 0;
-    //virtual void tickMouse          (float dt) { }
-  };
-
-
-  /**
-    @brief Interface class used for joy stick input listeners.
-  */
-  class _CoreExport JoyStickHandler : virtual public InputTickable
-  {
-  public:
-    virtual ~JoyStickHandler() { }
-    virtual void joyStickButtonPressed (int joyStickID, int button) = 0;
-    virtual void joyStickButtonReleased(int joyStickID, int button) = 0;
-    virtual void joyStickButtonHeld    (int joyStickID, int button) = 0;
-    virtual void joyStickAxisMoved     (int joyStickID, int axis, float value) = 0;
-    //virtual bool joyStickVector3Moved  (int joyStickID, int index /*, fill list*/) {return true;}
-    //virtual void tickJoyStick          (float dt) { }
-  };
-
-}
-
-#endif /* _InputInterfaces_H__ */
Index: de/trunk/src/core/InputManager.cc
===================================================================
--- /code/trunk/src/core/InputManager.cc	(revision 1534)
+++ 	(revision )
@@ -1,1543 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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 Implementation of the InputManager that captures all the input from OIS
-         and redirects it to handlers.
- */
-
-#include "InputManager.h"
-#include "util/Convert.h"
-#include "CoreIncludes.h"
-#include "ConfigValueIncludes.h"
-#include "Debug.h"
-#include "InputBuffer.h"
-#include "KeyBinder.h"
-#include "CommandExecutor.h"
-#include "ConsoleCommand.h"
-#include "Shell.h"
-
-namespace orxonox
-{
-  SetConsoleCommandShortcut(InputManager, keyBind);
-  SetConsoleCommandShortcut(InputManager, storeKeyStroke);
-  SetConsoleCommandShortcut(InputManager, calibrate);
-
-  // ###############################
-  // ###    Internal Methods     ###
-  // ###############################
-  // ###############################
-
-  /**
-    @brief Constructor only sets member fields to initial zero values
-           and registers the class in the class hierarchy.
-  */
-  InputManager::InputManager() :
-      inputSystem_(0), keyboard_(0), mouse_(0),
-      joySticksSize_(0),
-      keyBinder_(0), keyDetector_(0), buffer_(0), calibratorCallback_(0),
-      state_(IS_UNINIT), stateRequest_(IS_UNINIT), savedState_(IS_UNINIT),
-      keyboardModifiers_(0)
-  {
-    RegisterObject(InputManager);
-  }
-
-  /**
-    @brief The one instance of the InputManager is stored in this function.
-    @return A reference to the only instance of the InputManager
-  */
-  InputManager& InputManager::_getSingleton()
-  {
-    static InputManager theOnlyInstance;
-    return theOnlyInstance;
-  }
-
-  /**
-    @brief Destructor only called at the end of the program, after main.
-  */
-  InputManager::~InputManager()
-  {
-    _destroy();
-  }
-
-  /**
-    @brief Creates the OIS::InputMananger, the keyboard, the mouse and
-           the joysticks and assigns the key bindings.
-    @param windowHnd The window handle of the render window
-    @param windowWidth The width of the render window
-    @param windowHeight The height of the render window
-  */
-  bool InputManager::_initialise(const size_t windowHnd, int windowWidth, int windowHeight,
-        bool createKeyboard, bool createMouse, bool createJoySticks)
-  {
-    if (state_ == IS_UNINIT)
-    {
-      CCOUT(3) << "Initialising Input System..." << std::endl;
-      CCOUT(ORX_DEBUG) << "Initialising OIS components..." << std::endl;
-
-      OIS::ParamList paramList;
-      std::ostringstream windowHndStr;
-
-      // Fill parameter list
-      windowHndStr << (unsigned int)windowHnd;
-      paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
-      //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
-      //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
-//#if defined OIS_LINUX_PLATFORM
-//      paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
-//#endif
-
-      try
-      {
-        inputSystem_ = OIS::InputManager::createInputSystem(paramList);
-        CCOUT(ORX_DEBUG) << "Created OIS input system" << std::endl;
-      }
-      catch (OIS::Exception ex)
-      {
-        CCOUT(ORX_ERROR) << "Error: Failed creating an OIS input system."
-            << "OIS message: \"" << ex.eText << "\"" << std::endl;
-        inputSystem_ = 0;
-        return false;
-      }
-
-      if (createKeyboard)
-        _initialiseKeyboard();
-
-      if (createMouse)
-        _initialiseMouse();
-
-      if (createJoySticks)
-        _initialiseJoySticks();
-
-      // Set mouse/joystick region
-      if (mouse_)
-      {
-        setWindowExtents(windowWidth, windowHeight);
-      }
-
-      state_ = IS_NONE;
-      CCOUT(ORX_DEBUG) << "Initialising OIS components done." << std::endl;
-
-      // InputManager holds the input buffer --> create one and add it.
-      buffer_ = new InputBuffer();
-      addKeyHandler(buffer_, "buffer");
-      Shell::getInstance().setInputBuffer(buffer_);
-
-      keyBinder_ = new KeyBinder();
-      keyBinder_->loadBindings();
-      addKeyHandler(keyBinder_, "keybinder");
-      addMouseHandler(keyBinder_, "keybinder");
-      addJoyStickHandler(keyBinder_, "keybinder");
-
-      keyDetector_ = new KeyDetector();
-      keyDetector_->loadBindings();
-      addKeyHandler(keyDetector_, "keydetector");
-      addMouseHandler(keyDetector_, "keydetector");
-      addJoyStickHandler(keyDetector_, "keydetector");
-
-      calibratorCallback_ = new CalibratorCallback();
-      addKeyHandler(calibratorCallback_, "calibratorcallback");
-
-      setConfigValues();
-
-      CCOUT(ORX_DEBUG) << "Initialising complete." << std::endl;
-    }
-    else
-    {
-      CCOUT(ORX_WARNING) << "Warning: OIS compoments already initialised, skipping" << std::endl;
-    }
-    return true;
-  }
-
-  /**
-    @brief Creates a keyboard and sets the event handler.
-    @return False if keyboard stays uninitialised, true otherwise.
-  */
-  bool InputManager::_initialiseKeyboard()
-  {
-    if (keyboard_ != 0)
-    {
-      CCOUT(2) << "Warning: Keyboard already initialised, skipping." << std::endl;
-      return true;
-    }
-    try
-    {
-      if (inputSystem_->getNumberOfDevices(OIS::OISKeyboard) > 0)
-      {
-        keyboard_ = (OIS::Keyboard*)inputSystem_->createInputObject(OIS::OISKeyboard, true);
-        // register our listener in OIS.
-        keyboard_->setEventCallback(this);
-        // note: OIS will not detect keys that have already been down when the keyboard was created.
-        CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
-        return true;
-      }
-      else
-      {
-        CCOUT(ORX_WARNING) << "Warning: No keyboard found!" << std::endl;
-        return false;
-      }
-    }
-    catch (OIS::Exception ex)
-    {
-      // TODO: Test this output regarding formatting
-      CCOUT(ORX_WARNING) << "Warning: Failed to create an OIS keyboard\n"
-          << "OIS error message: \"" << ex.eText << "\"" << std::endl;
-      keyboard_ = 0;
-      return false;
-    }
-  }
-
-  /**
-    @brief Creates a mouse and sets the event handler.
-    @return False if mouse stays uninitialised, true otherwise.
-  */
-  bool InputManager::_initialiseMouse()
-  {
-    if (mouse_ != 0)
-    {
-      CCOUT(2) << "Warning: Mouse already initialised, skipping." << std::endl;
-      return true;
-    }
-    try
-    {
-      if (inputSystem_->getNumberOfDevices(OIS::OISMouse) > 0)
-      {
-        mouse_ = static_cast<OIS::Mouse*>(inputSystem_->createInputObject(OIS::OISMouse, true));
-        // register our listener in OIS.
-        mouse_->setEventCallback(this);
-        CCOUT(ORX_DEBUG) << "Created OIS mouse" << std::endl;
-        return true;
-      }
-      else
-      {
-        CCOUT(ORX_WARNING) << "Warning: No mouse found!" << std::endl;
-        return false;
-      }
-    }
-    catch (OIS::Exception ex)
-    {
-      CCOUT(ORX_WARNING) << "Warning: Failed to create an OIS mouse\n"
-          << "OIS error message: \"" << ex.eText << "\"" << std::endl;
-      mouse_ = 0;
-      return false;
-    }
-  }
-
-  /**
-    @brief Creates all joy sticks and sets the event handler.
-    @return False joy stick stay uninitialised, true otherwise.
-  */
-  bool InputManager::_initialiseJoySticks()
-  {
-    if (joySticksSize_ > 0)
-    {
-      CCOUT(2) << "Warning: Joy sticks already initialised, skipping." << std::endl;
-      return true;
-    }
-    bool success = false;
-    if (inputSystem_->getNumberOfDevices(OIS::OISJoyStick) > 0)
-    {
-      for (int i = 0; i < inputSystem_->getNumberOfDevices(OIS::OISJoyStick); i++)
-      {
-        try
-        {
-          OIS::JoyStick* stig = static_cast<OIS::JoyStick*>(inputSystem_->createInputObject(OIS::OISJoyStick, true));
-          joySticks_.push_back(stig);
-          // register our listener in OIS.
-          stig->setEventCallback(this);
-          CCOUT(ORX_DEBUG) << "Created OIS joy stick with ID " << stig->getID() << std::endl;
-          success = true;
-        }
-        catch (OIS::Exception ex)
-        {
-          CCOUT(ORX_WARNING) << "Warning: Failed to create OIS joy number" << i << "\n"
-              << "OIS error message: \"" << ex.eText << "\"" << std::endl;
-        }
-      }
-    }
-    else
-    {
-      CCOUT(ORX_WARNING) << "Warning: Joy stick support requested, but no joy stick was found" << std::endl;
-      return false;
-    }
-    joySticksSize_ = joySticks_.size();
-    activeJoyStickHandlers_.resize(joySticksSize_);
-    joyStickButtonsDown_.resize(joySticksSize_);
-    povStates_.resize(joySticksSize_);
-    sliderStates_.resize(joySticksSize_);
-    joySticksCalibration_.resize(joySticksSize_);
-    for (unsigned int iJoyStick = 0; iJoyStick < joySticksSize_; iJoyStick++)
-    {
-      // reset the calibration with default values
-      for (unsigned int i = 0; i < 24; i++)
-      {
-        joySticksCalibration_[iJoyStick].negativeCoeff[i] = 1.0f/32767.0f;
-        joySticksCalibration_[iJoyStick].positiveCoeff[i] = 1.0f/32768.0f;
-        joySticksCalibration_[iJoyStick].zeroStates[i] = 0;
-      }
-    }
-    return success;
-  }
-
-  /**
-    @brief Sets the configurable values. Use keybindings.ini as file..
-  */
-  void InputManager::setConfigValues()
-  {
-    if (joySticksSize_)
-    {
-      std::vector<MultiTypeMath> coeffPos;
-      std::vector<MultiTypeMath> coeffNeg;
-      std::vector<MultiTypeMath> zero;
-      coeffPos.resize(24);
-      coeffNeg.resize(24);
-      zero.resize(24);
-      for (unsigned int i = 0; i < 24; i++)
-      {
-        coeffPos[i] =  1.0f/32767.0f;
-        coeffNeg[i] =  1.0f/32768.0f;
-        zero[i]     =  0;
-      }
-
-      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
-      if (!cont)
-      {
-          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffPos", coeffPos);
-          getIdentifier()->addConfigValueContainer("CoeffPos", cont);
-      }
-      cont->getValue(&coeffPos);
-
-      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
-      if (!cont)
-      {
-          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffNeg", coeffNeg);
-          getIdentifier()->addConfigValueContainer("CoeffNeg", cont);
-      }
-      cont->getValue(&coeffNeg);
-
-      cont = getIdentifier()->getConfigValueContainer("Zero");
-      if (!cont)
-      {
-          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "Zero", zero);
-          getIdentifier()->addConfigValueContainer("Zero", cont);
-      }
-      cont->getValue(&zero);
-
-      // copy values to our own variables
-      for (unsigned int i = 0; i < 24; i++)
-      {
-        joySticksCalibration_[0].positiveCoeff[i] = coeffPos[i];
-        joySticksCalibration_[0].negativeCoeff[i] = coeffNeg[i];
-        joySticksCalibration_[0].zeroStates[i]    = zero[i];
-      }
-    }
-  }
-
-  /**
-    @brief Destroys all the created input devices and sets the InputManager to construction state.
-  */
-  void InputManager::_destroy()
-  {
-    if (state_ != IS_UNINIT)
-    {
-      CCOUT(ORX_DEBUG) << "Destroying ..." << std::endl;
-
-      if (buffer_)
-        delete buffer_;
-
-      if (keyBinder_)
-        delete keyBinder_;
-
-      if (keyDetector_)
-        delete keyDetector_;
-
-      if (calibratorCallback_)
-        delete calibratorCallback_;
-
-      keyHandlers_.clear();
-      mouseHandlers_.clear();
-      joyStickHandlers_.clear();
-
-      _destroyKeyboard();
-      _destroyMouse();
-      _destroyJoySticks();
-
-      activeHandlers_.clear();
-
-      // inputSystem_ can never be 0, or else the code is mistaken
-      OIS::InputManager::destroyInputSystem(inputSystem_);
-      inputSystem_ = 0;
-
-      state_ = IS_UNINIT;
-      CCOUT(ORX_DEBUG) << "Destroying done." << std::endl;
-    }
-  }
-
-  /**
-    @brief Destroys the keyboard and sets it to 0.
-  */
-  void InputManager::_destroyKeyboard()
-  {
-    if (keyboard_)
-      // inputSystem_ can never be 0, or else the code is mistaken
-      inputSystem_->destroyInputObject(keyboard_);
-    keyboard_ = 0;
-    activeKeyHandlers_.clear();
-    keysDown_.clear();
-    CCOUT(ORX_DEBUG) << "Keyboard destroyed." << std::endl;
-  }
-
-  /**
-    @brief Destroys the mouse and sets it to 0.
-  */
-  void InputManager::_destroyMouse()
-  {
-    if (mouse_)
-      // inputSystem_ can never be 0, or else the code is mistaken
-      inputSystem_->destroyInputObject(mouse_);
-    mouse_ = 0;
-    activeMouseHandlers_.clear();
-    mouseButtonsDown_.clear();
-    CCOUT(ORX_DEBUG) << "Mouse destroyed." << std::endl;
-  }
-
-  /**
-    @brief Destroys all the joy sticks and resizes the lists to 0.
-  */
-  void InputManager::_destroyJoySticks()
-  {
-    if (joySticksSize_ > 0)
-    {
-      // note: inputSystem_ can never be 0, or else the code is mistaken
-      for (unsigned int i = 0; i < joySticksSize_; i++)
-        if (joySticks_[i] != 0)
-          inputSystem_->destroyInputObject(joySticks_[i]);
-
-      joySticks_.clear();
-      joySticksSize_ = 0;
-      activeJoyStickHandlers_.clear();
-      joyStickButtonsDown_.clear();
-      povStates_.clear();
-      sliderStates_.clear();
-      joySticksCalibration_.clear();
-    }
-    CCOUT(ORX_DEBUG) << "Joy sticks destroyed." << std::endl;
-  }
-
-  void InputManager::_saveState()
-  {
-    savedHandlers_.activeHandlers_ = activeHandlers_;
-    savedHandlers_.activeJoyStickHandlers_ = activeJoyStickHandlers_;
-    savedHandlers_.activeKeyHandlers_ = activeKeyHandlers_;
-    savedHandlers_.activeMouseHandlers_ = activeMouseHandlers_;
-  }
-
-  void InputManager::_restoreState()
-  {
-    activeHandlers_ = savedHandlers_.activeHandlers_;
-    activeJoyStickHandlers_ = savedHandlers_.activeJoyStickHandlers_;
-    activeKeyHandlers_ = savedHandlers_.activeKeyHandlers_;
-    activeMouseHandlers_ = savedHandlers_.activeMouseHandlers_;
-  }
-
-  void InputManager::_updateTickables()
-  {
-    // we can use a map to have a list of unique pointers (an object can implement all 3 handlers)
-    std::map<InputTickable*, HandlerState> tempSet;
-    for (unsigned int iHandler = 0; iHandler < activeKeyHandlers_.size(); iHandler++)
-      tempSet[activeKeyHandlers_[iHandler]].joyStick = true;
-    for (unsigned int iHandler = 0; iHandler < activeMouseHandlers_.size(); iHandler++)
-      tempSet[activeMouseHandlers_[iHandler]].mouse = true;
-    for (unsigned int iJoyStick  = 0; iJoyStick < joySticksSize_; iJoyStick++)
-      for (unsigned int iHandler = 0; iHandler  < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-        tempSet[activeJoyStickHandlers_[iJoyStick][iHandler]].joyStick = true;
-
-    // copy the content of the map back to the actual vector
-    activeHandlers_.clear();
-    for (std::map<InputTickable*, HandlerState>::const_iterator itHandler = tempSet.begin();
-        itHandler != tempSet.end(); itHandler++)
-      activeHandlers_.push_back(std::pair<InputTickable*, HandlerState>((*itHandler).first, (*itHandler).second));
-  }
-
-
-  // #################################
-  // ### Private Interface Methods ###
-  // #################################
-  // #################################
-
-  /**
-    @brief Updates the InputManager. Tick is called by Orxonox.
-    @param dt Delta time
-  */
-  void InputManager::tick(float dt)
-  {
-    if (state_ == IS_UNINIT)
-      return;
-
-    if (state_ != stateRequest_)
-    {
-      InputState sr = stateRequest_;
-      switch (sr)
-      {
-      case IS_NORMAL:
-        activeKeyHandlers_.clear();
-        activeMouseHandlers_.clear();
-        for (unsigned int i = 0; i < joySticksSize_; i++)
-          activeJoyStickHandlers_[i].clear();
-
-        // normal play mode
-        // note: we assume that the handlers exist since otherwise, something's wrong anyway.
-        enableKeyHandler("keybinder");
-        enableMouseHandler("keybinder");
-        enableJoyStickHandler("keybinder", 0);
-        stateRequest_ = IS_NORMAL;
-        state_ = IS_NORMAL;
-        break;
-
-      case IS_GUI:
-        state_ = IS_GUI;
-        break;
-
-      case IS_CONSOLE:
-        activeKeyHandlers_.clear();
-        activeMouseHandlers_.clear();
-        for (unsigned int i = 0; i < joySticksSize_; i++)
-          activeJoyStickHandlers_[i].clear();
-
-        enableMouseHandler("keybinder");
-        enableJoyStickHandler("keybinder", 0);
-        enableKeyHandler("buffer");
-        stateRequest_ = IS_CONSOLE;
-        state_ = IS_CONSOLE;
-        break;
-
-      case IS_DETECT:
-        savedState_ = state_;
-        _saveState();
-
-        activeKeyHandlers_.clear();
-        activeMouseHandlers_.clear();
-        for (unsigned int i = 0; i < joySticksSize_; i++)
-          activeJoyStickHandlers_[i].clear();
-
-        enableKeyHandler("keydetector");
-        enableMouseHandler("keydetector");
-        enableJoyStickHandler("keydetector", 0);
-
-        stateRequest_ = IS_DETECT;
-        state_ = IS_DETECT;
-        break;
-
-      case IS_NODETECT:
-        _restoreState();
-        keysDown_.clear();
-        mouseButtonsDown_.clear();
-        joyStickButtonsDown_[0].clear();
-        state_ = IS_NODETECT;
-        stateRequest_ = savedState_;
-        break;
-
-      case IS_CALIBRATE:
-        if (joySticksSize_)
-        {
-          savedState_ = _getSingleton().state_;
-          for (unsigned int i = 0; i < 24; i++)
-          {
-            marginalsMax_[i] = INT_MIN;
-            marginalsMin_[i] = INT_MAX;
-          }
-          COUT(0) << "Move all joy stick axes in all directions a few times. "
-            << "Then put all axes in zero state and hit enter." << std::endl;
-
-          savedState_ = state_;
-          _saveState();
-
-          activeKeyHandlers_.clear();
-          activeMouseHandlers_.clear();
-          for (unsigned int i = 0; i < joySticksSize_; i++)
-            activeJoyStickHandlers_[i].clear();
-
-          enableKeyHandler("calibratorcallback");
-          stateRequest_ = IS_CALIBRATE;
-          state_ = IS_CALIBRATE;
-        }
-        else
-        {
-          COUT(3) << "Connot calibrate, no joy stick found!" << std::endl;
-          stateRequest_ = state_;
-        }
-        break;
-
-      case IS_NOCALIBRATE:
-        _completeCalibration();
-        _restoreState();
-        keyBinder_->resetJoyStickAxes();
-        state_ = IS_NOCALIBRATE;
-        stateRequest_ = savedState_;
-        break;
-
-      case IS_NONE:
-        activeKeyHandlers_.clear();
-        activeMouseHandlers_.clear();
-        for (unsigned int i = 0; i < joySticksSize_; i++)
-          activeJoyStickHandlers_[i].clear();
-        state_ = IS_NONE;
-
-      default:
-        break;
-      }
-    }
-
-    // Capture all the input. This calls the event handlers in InputManager.
-    if (mouse_)
-      mouse_->capture();
-    if (keyboard_)
-      keyboard_->capture();
-    for (unsigned  int i = 0; i < joySticksSize_; i++)
-      joySticks_[i]->capture();
-
-    if (state_ != IS_CALIBRATE)
-    {
-      // call all the handlers for the held key events
-      for (unsigned int iKey = 0; iKey < keysDown_.size(); iKey++)
-        for (unsigned int iHandler = 0; iHandler < activeKeyHandlers_.size(); iHandler++)
-          activeKeyHandlers_[iHandler]->keyHeld(KeyEvent(keysDown_[iKey], keyboardModifiers_));
-
-      // call all the handlers for the held mouse button events
-      for (unsigned int iButton = 0; iButton < mouseButtonsDown_.size(); iButton++)
-        for (unsigned int iHandler = 0; iHandler < activeMouseHandlers_.size(); iHandler++)
-          activeMouseHandlers_[iHandler]->mouseButtonHeld(mouseButtonsDown_[iButton]);
-
-      // call all the handlers for the held joy stick button events
-      for (unsigned int iJoyStick  = 0; iJoyStick < joySticksSize_; iJoyStick++)
-        for (unsigned int iButton   = 0; iButton   < joyStickButtonsDown_[iJoyStick].size(); iButton++)
-          for (unsigned int iHandler = 0; iHandler  < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-            activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonHeld(iJoyStick, joyStickButtonsDown_[iJoyStick][iButton]);
-    }
-
-    // call the ticks for the handlers (need to be treated specially)
-    for (unsigned int iHandler = 0; iHandler < activeHandlers_.size(); iHandler++)
-      activeHandlers_[iHandler].first->tickInput(dt, activeHandlers_[iHandler].second);
-  }
-
-  void InputManager::_completeCalibration()
-  {
-    for (unsigned int i = 0; i < 24; i++)
-    {
-      // positive coefficient
-      if (marginalsMax_[i] == INT_MIN)
-        marginalsMax_[i] =  32767;
-      // coefficients
-      if (marginalsMax_[i] - joySticksCalibration_[0].zeroStates[i])
-        joySticksCalibration_[0].positiveCoeff[i] =  1.0f/(marginalsMax_[i] - joySticksCalibration_[0].zeroStates[i]);
-      else
-        joySticksCalibration_[0].positiveCoeff[i] =  1.0f;
-
-      // config value
-      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
-      assert(cont);
-      cont->set(i, joySticksCalibration_[0].positiveCoeff[i]);
-
-      // negative coefficient
-      if (marginalsMin_[i] == INT_MAX)
-        marginalsMin_[i] = -32768;
-      // coefficients
-      if (marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i])
-        joySticksCalibration_[0].negativeCoeff[i] = -1.0f/(marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i]);
-      else
-        joySticksCalibration_[0].negativeCoeff[i] =  1.0f;
-      // config value
-      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
-      assert(cont);
-      cont->set(i, joySticksCalibration_[0].negativeCoeff[i]);
-
-      // zero states
-      if (i < 8)
-      {
-        if (!(i & 1))
-          joySticksCalibration_[0].zeroStates[i] = joySticks_[0]->getJoyStickState().mSliders[i/2].abX;
-        else
-          joySticksCalibration_[0].zeroStates[i] = joySticks_[0]->getJoyStickState().mSliders[i/2].abY;
-      }
-      else
-      {
-        if (i - 8 < joySticks_[0]->getJoyStickState().mAxes.size())
-          joySticksCalibration_[0].zeroStates[i] = joySticks_[0]->getJoyStickState().mAxes[i - 8].abs;
-        else
-          joySticksCalibration_[0].zeroStates[i] = 0;
-      }
-      // config value
-      cont = getIdentifier()->getConfigValueContainer("Zero");
-      assert(cont);
-      cont->set(i, joySticksCalibration_[0].zeroStates[i]);
-    }
-  }
-
-  // ###### Key Events ######
-
-  /**
-    @brief Event handler for the keyPressed Event.
-    @param e Event information
-  */
-  bool InputManager::keyPressed(const OIS::KeyEvent &e)
-  {
-    // check whether the key already is in the list (can happen when focus was lost)
-    unsigned int iKey = 0;
-    while (iKey < keysDown_.size() && keysDown_[iKey].key != (KeyCode::Enum)e.key)
-      iKey++;
-    if (iKey == keysDown_.size())
-      keysDown_.push_back(Key(e));
-
-    // update modifiers
-    if(e.key == OIS::KC_RMENU    || e.key == OIS::KC_LMENU)
-      keyboardModifiers_ |= KeyboardModifier::Alt;   // alt key
-    if(e.key == OIS::KC_RCONTROL || e.key == OIS::KC_LCONTROL)
-      keyboardModifiers_ |= KeyboardModifier::Ctrl;  // ctrl key
-    if(e.key == OIS::KC_RSHIFT   || e.key == OIS::KC_LSHIFT)
-      keyboardModifiers_ |= KeyboardModifier::Shift; // shift key
-
-    for (unsigned int i = 0; i < activeKeyHandlers_.size(); i++)
-      activeKeyHandlers_[i]->keyPressed(KeyEvent(e, keyboardModifiers_));
-
-    return true;
-  }
-
-  /**
-    @brief Event handler for the keyReleased Event.
-    @param e Event information
-  */
-  bool InputManager::keyReleased(const OIS::KeyEvent &e)
-  {
-    // remove the key from the keysDown_ list
-    for (unsigned int iKey = 0; iKey < keysDown_.size(); iKey++)
-    {
-      if (keysDown_[iKey].key == (KeyCode::Enum)e.key)
-      {
-        keysDown_.erase(keysDown_.begin() + iKey);
-        break;
-      }
-    }
-
-    // update modifiers
-    if(e.key == OIS::KC_RMENU    || e.key == OIS::KC_LMENU)
-      keyboardModifiers_ &= ~KeyboardModifier::Alt;   // alt key
-    if(e.key == OIS::KC_RCONTROL || e.key == OIS::KC_LCONTROL)
-      keyboardModifiers_ &= ~KeyboardModifier::Ctrl;  // ctrl key
-    if(e.key == OIS::KC_RSHIFT   || e.key == OIS::KC_LSHIFT)
-      keyboardModifiers_ &= ~KeyboardModifier::Shift; // shift key
-
-    for (unsigned int i = 0; i < activeKeyHandlers_.size(); i++)
-      activeKeyHandlers_[i]->keyReleased(KeyEvent(e, keyboardModifiers_));
-
-    return true;
-  }
-
-
-  // ###### Mouse Events ######
-
-  /**
-    @brief Event handler for the mouseMoved Event.
-    @param e Event information
-  */
-  bool InputManager::mouseMoved(const OIS::MouseEvent &e)
-  {
-    // check for actual moved event
-    if (e.state.X.rel != 0 || e.state.Y.rel != 0)
-    {
-      for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-        activeMouseHandlers_[i]->mouseMoved(IntVector2(e.state.X.abs, e.state.Y.abs),
-            IntVector2(e.state.X.rel, e.state.Y.rel), IntVector2(e.state.width, e.state.height));
-    }
-
-    // check for mouse scrolled event
-    if (e.state.Z.rel != 0)
-    {
-      for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-        activeMouseHandlers_[i]->mouseScrolled(e.state.Z.abs, e.state.Z.rel);
-    }
-
-    return true;
-  }
-
-  /**
-    @brief Event handler for the mousePressed Event.
-    @param e Event information
-    @param id The ID of the mouse button
-  */
-  bool InputManager::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id)
-  {
-    // check whether the button already is in the list (can happen when focus was lost)
-    unsigned int iButton = 0;
-    while (iButton < mouseButtonsDown_.size() && mouseButtonsDown_[iButton] != (MouseButton::Enum)id)
-      iButton++;
-    if (iButton == mouseButtonsDown_.size())
-      mouseButtonsDown_.push_back((MouseButton::Enum)id);
-
-    for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-      activeMouseHandlers_[i]->mouseButtonPressed((MouseButton::Enum)id);
-
-    return true;
-  }
-
-  /**
-    @brief Event handler for the mouseReleased Event.
-    @param e Event information
-    @param id The ID of the mouse button
-  */
-  bool InputManager::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id)
-  {
-    // remove the button from the keysDown_ list
-    for (unsigned int iButton = 0; iButton < mouseButtonsDown_.size(); iButton++)
-    {
-      if (mouseButtonsDown_[iButton] == (MouseButton::Enum)id)
-      {
-        mouseButtonsDown_.erase(mouseButtonsDown_.begin() + iButton);
-        break;
-      }
-    }
-
-    for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-      activeMouseHandlers_[i]->mouseButtonReleased((MouseButton::Enum)id);
-
-    return true;
-  }
-
-
-  // ###### Joy Stick Events ######
-
-  inline unsigned int InputManager::_getJoystick(const OIS::JoyStickEvent& arg)
-  {
-    // use the device to identify which one called the method
-    OIS::JoyStick* joyStick = (OIS::JoyStick*)arg.device;
-    unsigned int iJoyStick = 0;
-    while (joySticks_[iJoyStick] != joyStick)
-    {
-      iJoyStick++;
-      if (iJoyStick == joySticksSize_)
-      {
-        CCOUT(3) << "Unknown joystick fired an event. This means there is a bug somewhere! Aborting." << std::endl;
-        abort();
-      }
-    }
-    return iJoyStick;
-  }
-
-  bool InputManager::buttonPressed(const OIS::JoyStickEvent &arg, int button)
-  {
-    unsigned int iJoyStick = _getJoystick(arg);
-
-    // check whether the button already is in the list (can happen when focus was lost)
-    std::vector<int>& buttonsDown = joyStickButtonsDown_[iJoyStick];
-    unsigned int iButton = 0;
-    while (iButton < buttonsDown.size() && buttonsDown[iButton] != button)
-      iButton++;
-    if (iButton == buttonsDown.size())
-      buttonsDown.push_back(button);
-
-    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonPressed(iJoyStick, button);
-
-    return true;
-  }
-
-  bool InputManager::buttonReleased(const OIS::JoyStickEvent &arg, int button)
-  {
-    unsigned int iJoyStick = _getJoystick(arg);
-
-    // remove the button from the joyStickButtonsDown_ list
-    std::vector<int>& buttonsDown = joyStickButtonsDown_[iJoyStick];
-    for (unsigned int iButton = 0; iButton < buttonsDown.size(); iButton++)
-    {
-      if (buttonsDown[iButton] == button)
-      {
-        buttonsDown.erase(buttonsDown.begin() + iButton);
-        break;
-      }
-    }
-
-    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonReleased(iJoyStick, button);
-
-    return true;
-  }
-
-  void InputManager::_fireAxis(unsigned int iJoyStick, int axis, int value)
-  {
-    if (state_ == IS_CALIBRATE)
-    {
-      if (value > marginalsMax_[axis])
-        marginalsMax_[axis] = value;
-      if (value < marginalsMin_[axis])
-        marginalsMin_[axis] = value;
-    }
-    else
-    {
-      float fValue = value - joySticksCalibration_[iJoyStick].zeroStates[axis];
-      if (fValue > 0.0f)
-        fValue *= joySticksCalibration_[iJoyStick].positiveCoeff[axis];
-      else
-        fValue *= joySticksCalibration_[iJoyStick].negativeCoeff[axis];
-
-      for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-        activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickAxisMoved(iJoyStick, axis, fValue);
-    }
-  }
-
-  bool InputManager::axisMoved(const OIS::JoyStickEvent &arg, int axis)
-  {
-    //if (arg.state.mAxes[axis].abs > 10000 || arg.state.mAxes[axis].abs < -10000)
-    //{ CCOUT(3) << "axis " << axis << " moved" << arg.state.mAxes[axis].abs << std::endl;}
-
-    unsigned int iJoyStick = _getJoystick(arg);
-
-    // keep in mind that the first 8 axes are reserved for the sliders
-    _fireAxis(iJoyStick, axis + 8, arg.state.mAxes[axis].abs);
-
-    return true;
-  }
-
-  bool InputManager::sliderMoved(const OIS::JoyStickEvent &arg, int id)
-  {
-    //if (arg.state.mSliders[id].abX > 10000 || arg.state.mSliders[id].abX < -10000)
-    //{CCOUT(3) << "slider " << id << " moved" << arg.state.mSliders[id].abX << std::endl;}
-    //CCOUT(3) << arg.state.mSliders[id].abX << "\t |" << arg.state.mSliders[id].abY << std::endl;
-
-    unsigned int iJoyStick = _getJoystick(arg);
-
-    if (sliderStates_[iJoyStick].sliderStates[id].x != arg.state.mSliders[id].abX)
-      _fireAxis(iJoyStick, id * 2, arg.state.mSliders[id].abX);
-    else if (sliderStates_[iJoyStick].sliderStates[id].y != arg.state.mSliders[id].abY)
-      _fireAxis(iJoyStick, id * 2 + 1, arg.state.mSliders[id].abY);
-
-    return true;
-  }
-
-  bool InputManager::povMoved(const OIS::JoyStickEvent &arg, int id)
-  {
-    unsigned int iJoyStick = _getJoystick(arg);
-
-    // translate the POV into 8 simple buttons
-    int lastState = povStates_[iJoyStick][id];
-    if (lastState & OIS::Pov::North)
-      buttonReleased(arg, 32 + id * 4 + 0);
-    if (lastState & OIS::Pov::South)
-      buttonReleased(arg, 32 + id * 4 + 1);
-    if (lastState & OIS::Pov::East)
-      buttonReleased(arg, 32 + id * 4 + 2);
-    if (lastState & OIS::Pov::West)
-      buttonReleased(arg, 32 + id * 4 + 3);
-
-    povStates_[iJoyStick].povStates[id] = arg.state.mPOV[id].direction;
-
-    int currentState = povStates_[iJoyStick][id];
-    if (currentState & OIS::Pov::North)
-      buttonPressed(arg, 32 + id * 4 + 0);
-    if (currentState & OIS::Pov::South)
-      buttonPressed(arg, 32 + id * 4 + 1);
-    if (currentState & OIS::Pov::East)
-      buttonPressed(arg, 32 + id * 4 + 2);
-    if (currentState & OIS::Pov::West)
-      buttonPressed(arg, 32 + id * 4 + 3);
-
-    return true;
-  }
-
-  /*bool InputManager::vector3Moved(const OIS::JoyStickEvent &arg, int id)
-  {
-    unsigned int iJoyStick = _getJoystick(arg);
-
-    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickVector3Moved(JoyStickState(arg.state, iJoyStick), id);
-
-    return true;
-  }*/
-
-
-  // ################################
-  // ### Static Interface Methods ###
-  // ################################
-  // ################################
-
-  std::string InputManager::bindingCommmandString_s = "";
-
-  bool InputManager::initialise(const size_t windowHnd, int windowWidth, int windowHeight,
-    bool createKeyboard, bool createMouse, bool createJoySticks)
-  {
-    return _getSingleton()._initialise(windowHnd, windowWidth, windowHeight,
-          createKeyboard, createMouse, createJoySticks);
-  }
-
-  bool InputManager::initialiseKeyboard()
-  {
-    return _getSingleton()._initialiseKeyboard();
-  }
-
-  bool InputManager::initialiseMouse()
-  {
-    return _getSingleton()._initialiseMouse();
-  }
-
-  bool InputManager::initialiseJoySticks()
-  {
-    return _getSingleton()._initialiseJoySticks();
-  }
-
-  int InputManager::numberOfKeyboards()
-  {
-    if (_getSingleton().keyboard_ != 0)
-      return 1;
-    else
-      return 0;
-  }
-
-  int InputManager::numberOfMice()
-  {
-    if (_getSingleton().mouse_ != 0)
-      return 1;
-    else
-      return 0;
-  }
-
-  int InputManager::numberOfJoySticks()
-  {
-    return _getSingleton().joySticksSize_;
-  }
-
-  /*bool InputManager::isKeyDown(KeyCode::Enum key)
-  {
-    if (_getSingleton().keyboard_)
-      return _getSingleton().keyboard_->isKeyDown((OIS::KeyCode)key);
-    else
-      return false;
-  }*/
-
-  /*bool InputManager::isModifierDown(KeyboardModifier::Enum modifier)
-  {
-    if (_getSingleton().keyboard_)
-      return isModifierDown(modifier);
-    else
-      return false;
-  }*/
-
-  /*const MouseState InputManager::getMouseState()
-  {
-    if (_getSingleton().mouse_)
-      return _getSingleton().mouse_->getMouseState();
-    else
-      return MouseState();
-  }*/
-
-  /*const JoyStickState InputManager::getJoyStickState(unsigned int ID)
-  {
-    if (ID < _getSingleton().joySticksSize_)
-      return JoyStickState(_getSingleton().joySticks_[ID]->getJoyStickState(), ID);
-    else
-      return JoyStickState();
-  }*/
-
-  void InputManager::destroy()
-  {
-    _getSingleton()._destroy();
-  }
-
-  void InputManager::destroyKeyboard()
-  {
-    return _getSingleton()._destroyKeyboard();
-  }
-
-  void InputManager::destroyMouse()
-  {
-    return _getSingleton()._destroyMouse();
-  }
-
-  void InputManager::destroyJoySticks()
-  {
-    return _getSingleton()._destroyJoySticks();
-  }
-
-
-  /**
-    @brief Adjusts the mouse window metrics.
-    This method has to be called every time the size of the window changes.
-    @param width The new width of the render window
-    @param height the new height of the render window
-  */
-  void InputManager::setWindowExtents(const int width, const int height)
-  {
-    if (_getSingleton().mouse_)
-    {
-      // Set mouse region (if window resizes, we should alter this to reflect as well)
-      const OIS::MouseState &mouseState = _getSingleton().mouse_->getMouseState();
-      mouseState.width  = width;
-      mouseState.height = height;
-    }
-  }
-
-  /**
-    @brief Sets the input mode to either GUI, inGame or Buffer
-    @param mode The new input mode
-    @remark Only has an affect if the mode actually changes
-  */
-  void InputManager::setInputState(const InputState state)
-  {
-    _getSingleton().stateRequest_ = state;
-  }
-
-  /**
-    @brief Returns the current input handling method
-    @return The current input mode.
-  */
-  InputManager::InputState InputManager::getInputState()
-  {
-    return _getSingleton().state_;
-  }
-
-  void InputManager::storeKeyStroke(const std::string& name)
-  {
-    setInputState(IS_NODETECT);
-    COUT(0) << "Binding string \"" << bindingCommmandString_s << "\" on key '" << name << "'" << std::endl;
-    CommandExecutor::execute("config KeyBinder " + name + " " + bindingCommmandString_s, false);
-  }
-
-  void InputManager::keyBind(const std::string& command)
-  {
-    bindingCommmandString_s = command;
-    setInputState(IS_DETECT);
-    COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
-  }
-
-  void InputManager::calibrate()
-  {
-    _getSingleton().setInputState(IS_CALIBRATE);
-  }
-
-  // ###### KeyHandler ######
-
-  /**
-    @brief Adds a new key handler.
-    @param handler Pointer to the handler object.
-    @param name Unique name of the handler.
-    @return True if added, false if name already existed.
-  */
-  bool InputManager::addKeyHandler(KeyHandler* handler, const std::string& name)
-  {
-    if (!handler)
-      return false;
-    if (_getSingleton().keyHandlers_.find(name) == _getSingleton().keyHandlers_.end())
-    {
-      _getSingleton().keyHandlers_[name] = handler;
-      return true;
-    }
-    else
-      return false;
-  }
-
-  /**
-    @brief Removes a Key handler from the list.
-    @param name Unique name of the handler.
-    @return True if removal was successful, false if name was not found.
-  */
-  bool InputManager::removeKeyHandler(const std::string &name)
-  {
-    disableKeyHandler(name);
-    std::map<std::string, KeyHandler*>::iterator it = _getSingleton().keyHandlers_.find(name);
-    if (it != _getSingleton().keyHandlers_.end())
-    {
-      _getSingleton().keyHandlers_.erase(it);
-      return true;
-    }
-    else
-      return false;
-  }
-
-  /**
-    @brief Returns the pointer to a handler.
-    @param name Unique name of the handler.
-    @return Pointer to the instance, 0 if name was not found.
-  */
-  KeyHandler* InputManager::getKeyHandler(const std::string& name)
-  {
-    std::map<std::string, KeyHandler*>::iterator it = _getSingleton().keyHandlers_.find(name);
-    if (it != _getSingleton().keyHandlers_.end())
-    {
-      return (*it).second;
-    }
-    else
-      return 0;
-  }
-
-  /**
-    @brief Enables a specific key handler that has already been added.
-    @param name Unique name of the handler.
-    @return False if name was not found, true otherwise.
-  */
-  bool InputManager::enableKeyHandler(const std::string& name)
-  {
-    // get pointer from the map with all stored handlers
-    std::map<std::string, KeyHandler*>::const_iterator mapIt = _getSingleton().keyHandlers_.find(name);
-    if (mapIt == _getSingleton().keyHandlers_.end())
-      return false;
-    // see whether the handler already is in the list
-    for (std::vector<KeyHandler*>::iterator it = _getSingleton().activeKeyHandlers_.begin();
-          it != _getSingleton().activeKeyHandlers_.end(); it++)
-    {
-      if ((*it) == (*mapIt).second)
-      {
-        return true;
-      }
-    }
-    _getSingleton().activeKeyHandlers_.push_back((*mapIt).second);
-    _getSingleton().stateRequest_ = IS_CUSTOM;
-    _getSingleton()._updateTickables();
-    return true;
-  }
-
-  /**
-    @brief Disables a specific key handler.
-    @param name Unique name of the handler.
-    @return False if name was not found, true otherwise.
-  */
-  bool InputManager::disableKeyHandler(const std::string &name)
-  {
-    // get pointer from the map with all stored handlers
-    std::map<std::string, KeyHandler*>::const_iterator mapIt = _getSingleton().keyHandlers_.find(name);
-    if (mapIt == _getSingleton().keyHandlers_.end())
-      return false;
-    // look for the handler in the list
-    for (std::vector<KeyHandler*>::iterator it = _getSingleton().activeKeyHandlers_.begin();
-          it != _getSingleton().activeKeyHandlers_.end(); it++)
-    {
-      if ((*it) == (*mapIt).second)
-      {
-        _getSingleton().activeKeyHandlers_.erase(it);
-        _getSingleton().stateRequest_ = IS_CUSTOM;
-        _getSingleton()._updateTickables();
-        return true;
-      }
-    }
-    return true;
-  }
-
-  /**
-    @brief Checks whether a key handler is active
-    @param name Unique name of the handler.
-    @return False if key handler is not active or doesn't exist, true otherwise.
-  */
-  bool InputManager::isKeyHandlerActive(const std::string& name)
-  {
-    // get pointer from the map with all stored handlers
-    std::map<std::string, KeyHandler*>::const_iterator mapIt = _getSingleton().keyHandlers_.find(name);
-    if (mapIt == _getSingleton().keyHandlers_.end())
-      return false;
-    // see whether the handler already is in the list
-    for (std::vector<KeyHandler*>::iterator it = _getSingleton().activeKeyHandlers_.begin();
-          it != _getSingleton().activeKeyHandlers_.end(); it++)
-    {
-      if ((*it) == (*mapIt).second)
-        return true;
-    }
-    return false;
-  }
-
-
-  // ###### MouseHandler ######
-  /**
-    @brief Adds a new mouse handler.
-    @param handler Pointer to the handler object.
-    @param name Unique name of the handler.
-    @return True if added, false if name already existed.
-  */
-  bool InputManager::addMouseHandler(MouseHandler* handler, const std::string& name)
-  {
-    if (!handler)
-      return false;
-    if (_getSingleton().mouseHandlers_.find(name) == _getSingleton().mouseHandlers_.end())
-    {
-      _getSingleton().mouseHandlers_[name] = handler;
-      return true;
-    }
-    else
-      return false;
-  }
-
-  /**
-    @brief Removes a Mouse handler from the list.
-    @param name Unique name of the handler.
-    @return True if removal was successful, false if name was not found.
-  */
-  bool InputManager::removeMouseHandler(const std::string &name)
-  {
-    disableMouseHandler(name);
-    std::map<std::string, MouseHandler*>::iterator it = _getSingleton().mouseHandlers_.find(name);
-    if (it != _getSingleton().mouseHandlers_.end())
-    {
-      _getSingleton().mouseHandlers_.erase(it);
-      return true;
-    }
-    else
-      return false;
-  }
-
-  /**
-    @brief Returns the pointer to a handler.
-    @param name Unique name of the handler.
-    @return Pointer to the instance, 0 if name was not found.
-  */
-  MouseHandler* InputManager::getMouseHandler(const std::string& name)
-  {
-    std::map<std::string, MouseHandler*>::iterator it = _getSingleton().mouseHandlers_.find(name);
-    if (it != _getSingleton().mouseHandlers_.end())
-    {
-      return (*it).second;
-    }
-    else
-      return 0;
-  }
-
-  /**
-    @brief Enables a specific mouse handler that has already been added.
-    @param name Unique name of the handler.
-    @return False if name was not found, true otherwise.
-  */
-  bool InputManager::enableMouseHandler(const std::string& name)
-  {
-    // get pointer from the map with all stored handlers
-    std::map<std::string, MouseHandler*>::const_iterator mapIt = _getSingleton().mouseHandlers_.find(name);
-    if (mapIt == _getSingleton().mouseHandlers_.end())
-      return false;
-    // see whether the handler already is in the list
-    for (std::vector<MouseHandler*>::iterator it = _getSingleton().activeMouseHandlers_.begin();
-          it != _getSingleton().activeMouseHandlers_.end(); it++)
-    {
-      if ((*it) == (*mapIt).second)
-      {
-        return true;
-      }
-    }
-    _getSingleton().activeMouseHandlers_.push_back((*mapIt).second);
-    _getSingleton().stateRequest_ = IS_CUSTOM;
-    _getSingleton()._updateTickables();
-    return true;
-  }
-
-  /**
-    @brief Disables a specific mouse handler.
-    @param name Unique name of the handler.
-    @return False if name was not found, true otherwise.
-  */
-  bool InputManager::disableMouseHandler(const std::string &name)
-  {
-    // get pointer from the map with all stored handlers
-    std::map<std::string, MouseHandler*>::const_iterator mapIt = _getSingleton().mouseHandlers_.find(name);
-    if (mapIt == _getSingleton().mouseHandlers_.end())
-      return false;
-    // look for the handler in the list
-    for (std::vector<MouseHandler*>::iterator it = _getSingleton().activeMouseHandlers_.begin();
-          it != _getSingleton().activeMouseHandlers_.end(); it++)
-    {
-      if ((*it) == (*mapIt).second)
-      {
-        _getSingleton().activeMouseHandlers_.erase(it);
-        _getSingleton().stateRequest_ = IS_CUSTOM;
-        _getSingleton()._updateTickables();
-        return true;
-      }
-    }
-    return true;
-  }
-
-  /**
-    @brief Checks whether a mouse handler is active
-    @param name Unique name of the handler.
-    @return False if key handler is not active or doesn't exist, true otherwise.
-  */
-  bool InputManager::isMouseHandlerActive(const std::string& name)
-  {
-    // get pointer from the map with all stored handlers
-    std::map<std::string, MouseHandler*>::const_iterator mapIt = _getSingleton().mouseHandlers_.find(name);
-    if (mapIt == _getSingleton().mouseHandlers_.end())
-      return false;
-    // see whether the handler already is in the list
-    for (std::vector<MouseHandler*>::iterator it = _getSingleton().activeMouseHandlers_.begin();
-          it != _getSingleton().activeMouseHandlers_.end(); it++)
-    {
-      if ((*it) == (*mapIt).second)
-        return true;
-    }
-    return false;
-  }
-
-
-  // ###### JoyStickHandler ######
-
-  /**
-    @brief Adds a new joy stick handler.
-    @param handler Pointer to the handler object.
-    @param name Unique name of the handler.
-    @return True if added, false if name already existed.
-  */
-  bool InputManager::addJoyStickHandler(JoyStickHandler* handler, const std::string& name)
-  {
-    if (!handler)
-      return false;
-    if (_getSingleton().joyStickHandlers_.find(name) == _getSingleton().joyStickHandlers_.end())
-    {
-      _getSingleton().joyStickHandlers_[name] = handler;
-      return true;
-    }
-    else
-      return false;
-  }
-
-  /**
-    @brief Removes a JoyStick handler from the list.
-    @param name Unique name of the handler.
-    @return True if removal was successful, false if name was not found.
-  */
-  bool InputManager::removeJoyStickHandler(const std::string &name)
-  {
-    for (std::vector<OIS::JoyStick*>::iterator itstick = _getSingleton().joySticks_.begin();
-          itstick != _getSingleton().joySticks_.end(); itstick++)
-      disableJoyStickHandler(name, itstick - _getSingleton().joySticks_.begin());
-
-    std::map<std::string, JoyStickHandler*>::iterator it = _getSingleton().joyStickHandlers_.find(name);
-    if (it != _getSingleton().joyStickHandlers_.end())
-    {
-      _getSingleton().joyStickHandlers_.erase(it);
-      return true;
-    }
-    else
-      return false;
-  }
-
-  /**
-    @brief Returns the pointer to a handler.
-    @param name Unique name of the handler.
-    @return Pointer to the instance, 0 if name was not found.
-  */
-  JoyStickHandler* InputManager::getJoyStickHandler(const std::string& name)
-  {
-    std::map<std::string, JoyStickHandler*>::iterator it = _getSingleton().joyStickHandlers_.find(name);
-    if (it != _getSingleton().joyStickHandlers_.end())
-    {
-      return (*it).second;
-    }
-    else
-      return 0;
-  }
-
-  /**
-    @brief Enables a specific joy stick handler that has already been added.
-    @param name Unique name of the handler.
-    @return False if name or id was not found, true otherwise.
-  */
-  bool InputManager::enableJoyStickHandler(const std::string& name, unsigned int ID)
-  {
-    // get handler pointer from the map with all stored handlers
-    std::map<std::string, JoyStickHandler*>::const_iterator handlerIt = _getSingleton().joyStickHandlers_.find(name);
-    if (handlerIt == _getSingleton().joyStickHandlers_.end())
-      return false;
-
-    // check for existence of the ID
-    if (ID >= _getSingleton().joySticksSize_)
-      return false;
-
-    // see whether the handler already is in the list
-    for (std::vector<JoyStickHandler*>::iterator it = _getSingleton().activeJoyStickHandlers_[ID].begin();
-          it != _getSingleton().activeJoyStickHandlers_[ID].end(); it++)
-    {
-      if ((*it) == (*handlerIt).second)
-      {
-        return true;
-      }
-    }
-    _getSingleton().activeJoyStickHandlers_[ID].push_back((*handlerIt).second);
-    _getSingleton().stateRequest_ = IS_CUSTOM;
-    _getSingleton()._updateTickables();
-    return true;
-  }
-
-  /**
-    @brief Disables a specific joy stick handler.
-    @param name Unique name of the handler.
-    @return False if name or id was not found, true otherwise.
-  */
-  bool InputManager::disableJoyStickHandler(const std::string &name, unsigned int ID)
-  {
-    // get handler pointer from the map with all stored handlers
-    std::map<std::string, JoyStickHandler*>::const_iterator handlerIt = _getSingleton().joyStickHandlers_.find(name);
-    if (handlerIt == _getSingleton().joyStickHandlers_.end())
-      return false;
-
-    // check for existence of the ID
-    if (ID >= _getSingleton().joySticksSize_)
-      return false;
-
-    // look for the handler in the list
-    for (std::vector<JoyStickHandler*>::iterator it = _getSingleton().activeJoyStickHandlers_[ID].begin();
-          it != _getSingleton().activeJoyStickHandlers_[ID].end(); it++)
-    {
-      if ((*it) == (*handlerIt).second)
-      {
-        _getSingleton().activeJoyStickHandlers_[ID].erase(it);
-        _getSingleton().stateRequest_ = IS_CUSTOM;
-        _getSingleton()._updateTickables();
-        return true;
-      }
-    }
-    return true;
-  }
-
-  /**
-    @brief Checks whether a joy stick handler is active
-    @param name Unique name of the handler.
-    @return False if key handler is not active or doesn't exist, true otherwise.
-  */
-  bool InputManager::isJoyStickHandlerActive(const std::string& name, unsigned int ID)
-  {
-    // get handler pointer from the map with all stored handlers
-    std::map<std::string, JoyStickHandler*>::const_iterator handlerIt = _getSingleton().joyStickHandlers_.find(name);
-    if (handlerIt == _getSingleton().joyStickHandlers_.end())
-      return false;
-
-    // check for existence of the ID
-    if (ID >= _getSingleton().joySticksSize_)
-      return false;
-
-    // see whether the handler already is in the list
-    for (std::vector<JoyStickHandler*>::iterator it = _getSingleton().activeJoyStickHandlers_[ID].begin();
-          it != _getSingleton().activeJoyStickHandlers_[ID].end(); it++)
-    {
-      if ((*it) == (*handlerIt).second)
-        return true;
-    }
-    return false;
-  }
-
-}
Index: de/trunk/src/core/InputManager.h
===================================================================
--- /code/trunk/src/core/InputManager.h	(revision 1534)
+++ 	(revision )
@@ -1,260 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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 Implementation of a little Input handler that distributes everything
-        coming from OIS.
- */
-
-#ifndef _InputManager_H__
-#define _InputManager_H__
-
-#include "CorePrereqs.h"
-
-#include <map>
-#include <vector>
-
-#include "ois/OIS.h"
-#include "util/Math.h"
-#include "Tickable.h"
-#include "InputInterfaces.h"
-
-namespace orxonox
-{
-  /**
-  * Helper class to realise a vector<int[4]>
-  */
-  class POVStates
-  {
-  public:
-    int operator[](unsigned int index) { return povStates[index]; }
-    int povStates[4];
-  };
-
-  /**
-  * Helper class to realise a vector< {int[4], int[4]} >
-  */
-  class SliderStates
-  {
-  public:
-    IntVector2 sliderStates[4];
-  };
-
-  /**
-  * Struct for storing a custom input state
-  */
-  struct StoredState
-  {
-    std::vector<KeyHandler*>                    activeKeyHandlers_;
-    std::vector<MouseHandler*>                  activeMouseHandlers_;
-    std::vector<std::vector<JoyStickHandler*> > activeJoyStickHandlers_;
-    std::vector<std::pair<InputTickable*, HandlerState> > activeHandlers_;
-  };
-
-  struct JoyStickCalibration
-  {
-    int zeroStates[24];
-    float positiveCoeff[24];
-    float negativeCoeff[24];
-  };
-
-  /**
-    @brief Captures and distributes mouse and keyboard input.
-  */
-  class _CoreExport InputManager
-        : public TickableReal,
-          public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener
-  {
-  public: // enumerations
-    /**
-      @brief Designates the way input is handled and redirected.
-    */
-    enum InputState
-    {
-      IS_UNINIT,    //!< InputManager has not yet been initialised.
-      IS_NONE,      //!< Input is discarded.
-      IS_NORMAL,    //!< Normal play state. Key and button bindings are active.
-      IS_GUI,       //!< All OIS input events are passed to CEGUI.
-      IS_CONSOLE,   //!< Keyboard input is redirected to the InputBuffer.
-      IS_DETECT,    //!< All the input additionally goes to the KeyDetector
-      IS_NODETECT,  //!< remove KeyDetector
-      IS_NOCALIBRATE,
-      IS_CALIBRATE,
-      IS_CUSTOM     //!< Any possible configuration.
-    };
-
-  public: // member functions
-    void setConfigValues();
-
-  public: // static functions
-    static bool initialise(const size_t windowHnd, int windowWidth, int windowHeight,
-          bool createKeyboard = true, bool createMouse = true, bool createJoySticks = false);
-    static bool initialiseKeyboard();
-    static bool initialiseMouse();
-    static bool initialiseJoySticks();
-    static int  numberOfKeyboards();
-    static int  numberOfMice();
-    static int  numberOfJoySticks();
-
-    static void destroy();
-    static void destroyKeyboard();
-    static void destroyMouse();
-    static void destroyJoySticks();
-
-    //static bool isModifierDown(KeyboardModifier::Enum modifier);
-    //static bool isKeyDown(KeyCode::Enum key);
-    //static const MouseState getMouseState();
-    //static const JoyStickState getJoyStickState(unsigned int ID);
-
-    static void setWindowExtents(const int width, const int height);
-
-    static void setInputState(const InputState state);
-    static InputState getInputState();
-
-    static void storeKeyStroke(const std::string& name);
-    static void keyBind(const std::string& command);
-
-    static void calibrate();
-
-    static bool addKeyHandler                 (KeyHandler* handler, const std::string& name);
-    static bool removeKeyHandler              (const std::string& name);
-    static KeyHandler* getKeyHandler          (const std::string& name);
-    static bool enableKeyHandler              (const std::string& name);
-    static bool disableKeyHandler             (const std::string& name);
-    static bool isKeyHandlerActive            (const std::string& name);
-
-    static bool addMouseHandler               (MouseHandler* handler, const std::string& name);
-    static bool removeMouseHandler            (const std::string& name);
-    static MouseHandler* getMouseHandler      (const std::string& name);
-    static bool enableMouseHandler            (const std::string& name);
-    static bool disableMouseHandler           (const std::string& name);
-    static bool isMouseHandlerActive          (const std::string& name);
-
-    static bool addJoyStickHandler            (JoyStickHandler* handler, const std::string& name);
-    static bool removeJoyStickHandler         (const std::string& name);
-    static JoyStickHandler* getJoyStickHandler(const std::string& name);
-    static bool enableJoyStickHandler         (const std::string& name, unsigned int id);
-    static bool disableJoyStickHandler        (const std::string& name, unsigned int id);
-    static bool isJoyStickHandlerActive       (const std::string& name, unsigned int id);
-
-  private: // functions
-    // don't mess with a Singleton
-    InputManager ();
-    InputManager (const InputManager&);
-    ~InputManager();
-
-    // Intenal methods
-    bool _initialise(const size_t, int, int, bool, bool, bool);
-    bool _initialiseKeyboard();
-    bool _initialiseMouse();
-    bool _initialiseJoySticks();
-
-    void _destroy();
-    void _destroyKeyboard();
-    void _destroyMouse();
-    void _destroyJoySticks();
-
-    void _updateTickables();
-
-    void _saveState();
-    void _restoreState();
-
-    void _completeCalibration();
-
-    void _fireAxis(unsigned int iJoyStick, int axis, int value);
-    unsigned int _getJoystick(const OIS::JoyStickEvent& arg);
-
-    void tick(float dt);
-
-    // input events
-    bool mousePressed  (const OIS::MouseEvent    &arg, OIS::MouseButtonID id);
-    bool mouseReleased (const OIS::MouseEvent    &arg, OIS::MouseButtonID id);
-    bool mouseMoved    (const OIS::MouseEvent    &arg);
-    bool keyPressed    (const OIS::KeyEvent      &arg);
-    bool keyReleased   (const OIS::KeyEvent      &arg);
-    bool buttonPressed (const OIS::JoyStickEvent &arg, int button);
-    bool buttonReleased(const OIS::JoyStickEvent &arg, int button);
-    bool axisMoved     (const OIS::JoyStickEvent &arg, int axis);
-    bool sliderMoved   (const OIS::JoyStickEvent &arg, int id);
-    bool povMoved      (const OIS::JoyStickEvent &arg, int id);
-    //bool vector3Moved  (const OIS::JoyStickEvent &arg, int id);
-
-    static InputManager& _getSingleton();
-    static InputManager* _getSingletonPtr() { return &_getSingleton(); }
-
-  private: // variables
-    OIS::InputManager*                          inputSystem_;     //!< OIS input manager
-    OIS::Keyboard*                              keyboard_;        //!< OIS mouse
-    OIS::Mouse*                                 mouse_;           //!< OIS keyboard
-    std::vector<OIS::JoyStick*>                 joySticks_;       //!< OIS joy sticks
-    unsigned int                                joySticksSize_;
-
-    KeyBinder*                                  keyBinder_;       //!< KeyBinder instance
-    KeyDetector*                                keyDetector_;     //!< KeyDetector instance
-    InputBuffer*                                buffer_;          //!< InputBuffer instance
-    CalibratorCallback*                         calibratorCallback_;
-
-    InputState state_;
-    InputState stateRequest_;
-    InputState savedState_;
-    unsigned int keyboardModifiers_;
-    StoredState savedHandlers_;
-
-    // joystick calibration
-    //std::vector<int> marginalsMaxConfig_;
-    //std::vector<int> marginalsMinConfig_;
-    int marginalsMax_[24];
-    int marginalsMin_[24];
-    bool bCalibrated_;
-
-    //! Keeps track of the joy stick POV states
-    std::vector<POVStates>                      povStates_;
-    //! Keeps track of the possibly two slider axes
-    std::vector<SliderStates>                   sliderStates_;
-    std::vector<JoyStickCalibration>            joySticksCalibration_;
-
-    std::map<std::string, KeyHandler*>          keyHandlers_;
-    std::map<std::string, MouseHandler*>        mouseHandlers_;
-    std::map<std::string, JoyStickHandler*>     joyStickHandlers_;
-
-    std::vector<KeyHandler*>                    activeKeyHandlers_;
-    std::vector<MouseHandler*>                  activeMouseHandlers_;
-    std::vector<std::vector<JoyStickHandler*> > activeJoyStickHandlers_;
-    std::vector<std::pair<InputTickable*, HandlerState> > activeHandlers_;
-
-    std::vector<Key>                            keysDown_;
-    std::vector<MouseButton::Enum>              mouseButtonsDown_;
-    std::vector<std::vector<int> >              joyStickButtonsDown_;
-
-    static std::string                          bindingCommmandString_s;
-  };
-
-}
-
-#endif /* _InputManager_H__ */
Index: de/trunk/src/core/KeyBinder.cc
===================================================================
--- /code/trunk/src/core/KeyBinder.cc	(revision 1534)
+++ 	(revision )
@@ -1,908 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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 Implementation of the different input handlers.
- */
-
-#include "KeyBinder.h"
-#include <fstream>
-#include <limits.h>
-#include "util/Convert.h"
-#include "util/SubString.h"
-#include "util/String.h"
-#include "Debug.h"
-#include "ConfigValueIncludes.h"
-#include "CoreIncludes.h"
-#include "CommandExecutor.h"
-#include "ConsoleCommand.h"
-#include "Executor.h"
-// TODO: only needed by the CalibratorCallback class; move to new file
-#include "InputManager.h"
-
-namespace orxonox
-{
-  // ###############################
-  // ###  BufferedParamCommand   ###
-  // ###############################
-
-  /**
-  * Executes a buffered command. This is used for commands with additional
-  * parameters.
-  * @return True if command execution was successful or value was zero.
-  */
-  bool BufferedParamCommand::execute()
-  {
-    if (nValuesAdded_)
-    {
-      BufferedParamCommand& cmd = *this;
-      cmd.evaluation_.setEvaluatedParameter(cmd.paramIndex_, cmd.value_);
-      // reset
-      cmd.nValuesAdded_ = 0;
-      cmd.value_ = 0;
-      return cmd.evaluation_.execute();
-    }
-    else
-      return true;
-  }
-
-  // ###############################
-  // #####    SimpleCommand    #####
-  // ###############################
-
-  /**
-  * Executes a simple command with no additional paramters.
-  * @return True if command execution was successful, false otherwise.
-  */
-  bool SimpleCommand::execute(float abs, float rel)
-  {
-    return evaluation_.execute();
-  }
-
-  // ###############################
-  // #####    ParamCommand     #####
-  // ###############################
-
-  /**
-  * Executes a parameter command. The commmand string is not directly executed,
-  * but instead stored in a buffer list so that values can be combined.
-  * @return Always true.
-  */
-  bool ParamCommand::execute(float abs, float rel)
-  {
-    BufferedParamCommand& cmd = *paramCommand_;
-    // command has an additional parameter
-    if (bRelative_)
-    {
-      if (rel != 0.0f)
-      {
-        // we have to calculate a relative movement.
-        // paramModifier_ says how much one keystroke is
-        cmd.value_ += paramModifier_ * rel;
-      }
-    }
-    else if (abs != 0.0f)
-    {
-      // Usually, joy sticks create 'noise' (they return values if they're in 0 position)
-      // and normally this is caught in tickInput(), but that threshold cannot be to high
-      // in order to preserve accuracy. Instead, we have to catch the problem here. An example:
-      // Someone only uses buttons with an active joystick. The joy stick value could then
-      // be 0.05 for instance and the the key value 1. Without handling the problem, the final
-      // value would be computed to (1+0.05)/2=0.5025 which is not what the user expects.
-      float absQ = abs * abs;
-      float valueQ = cmd.value_ * cmd.value_;
-      if (absQ > 50.0f * valueQ) // ease up comparison by using quadratics
-      {
-        cmd.value_ = abs * paramModifier_;
-        cmd.nValuesAdded_ = 1;
-      }
-      else if (absQ * 50.0f < valueQ)
-      {
-        // abs is too small, we just don't do anything
-      }
-      else
-      {
-        // we have to calculate the absolute position of the axis.
-        // Since there might be another axis that is affected, we have to wait and
-        // store the result in a temporary place
-        cmd.value_ = (cmd.value_ * cmd.nValuesAdded_ + paramModifier_ * abs) / ++cmd.nValuesAdded_;
-      }
-    }
-    return true;
-  }
-
-  // ###############################
-  // #####       Button        #####
-  // ###############################
-
-  void Button::clear()
-  {
-    for (unsigned int j = 0; j < 3; j++)
-    {
-      if (nCommands_[j])
-      {
-        // delete all commands and the command pointer array
-        for (unsigned int i = 0; i < nCommands_[j]; i++)
-          delete commands_[j][i];
-        delete[] commands_[j];
-        commands_[j] = 0;
-        nCommands_[j] = 0;
-      }
-      else
-      {
-        commands_[j] = 0;
-      }
-    }
-  }
-
-  void Button::parse(std::vector<BufferedParamCommand*>& paramCommandBuffer)
-  {
-    if (isEmpty(bindingString_))
-    {
-      clear();
-      return;
-    }
-
-    // use std::vector for a temporary dynamic array
-    std::vector<BaseCommand*> commands[3];
-
-
-    // separate the commands
-    SubString commandStrings(bindingString_, "|", SubString::WhiteSpaces, false,
-        '\\', false, '"', false, '(', ')', false, '\0');
-
-    for (unsigned int iCommand = 0; iCommand < commandStrings.size(); iCommand++)
-    {
-      if (commandStrings[iCommand] != "")
-      {
-        SubString tokens(commandStrings[iCommand], " ", SubString::WhiteSpaces, false,
-            '\\', false, '"', false, '(', ')', false, '\0');
-
-        unsigned int iToken = 0;
-
-        // for real axes, we can feed a ButtonThreshold argument as entire command
-        if (getLowercase(tokens[0]) == "buttonthreshold")
-        {
-          if (tokens.size() == 1)
-            continue;
-          // may fail, but doesn't matter
-          convertValue(&buttonThreshold_, tokens[1]);
-          continue;
-        }
-
-        // first argument can be OnPress, OnHold OnRelease or nothing
-        KeybindMode::Enum mode = KeybindMode::None;
-        if (getLowercase(tokens[iToken]) == "onpress")
-          mode = KeybindMode::OnPress,   iToken++;
-        if (getLowercase(tokens[iToken]) == "onrelease")
-          mode = KeybindMode::OnRelease, iToken++;
-        if (getLowercase(tokens[iToken]) == "onhold")
-          mode = KeybindMode::OnHold,    iToken++;
-
-        if (iToken == tokens.size())
-          continue;
-
-        // second argument can be the amplitude for the case it as an axis command
-        // default amplitude is 1.0f
-        float paramModifier = 1.0f;
-        if (getLowercase(tokens[iToken]) == "scale")
-        {
-          iToken++;
-          if (iToken == tokens.size() || !convertValue(&paramModifier, tokens[iToken]))
-          {
-            COUT(2) << "Error while parsing key binding " << name_
-                << ". Numeric expression expected afer 'AxisAmp', switching to default value" << std::endl;
-            if (iToken == tokens.size())
-              continue;
-          }
-          iToken++;
-        }
-
-        // no more arguments expected except for the actual command
-        if (iToken == tokens.size())
-          continue;
-
-        std::string commandStr;
-        while (iToken != tokens.size())
-          commandStr += tokens[iToken++] + " ";
-
-        // evaluate the command
-        CommandEvaluation eval = CommandExecutor::evaluate(commandStr);
-        if (!eval.isValid())
-          continue;
-
-        // check for param command
-        int paramIndex = eval.getConsoleCommand()->getAxisParamIndex();
-        if (paramIndex >= 0)
-        {
-          // parameter supported command
-          ParamCommand* cmd = new ParamCommand();
-          cmd->paramModifier_ = paramModifier;
-          cmd->bRelative_ = eval.getConsoleCommand()->getIsAxisRelative();
-
-          // add command to the buffer if not yet existing
-          for (unsigned int iParamCmd = 0; iParamCmd < paramCommandBuffer.size(); iParamCmd++)
-          {
-            if (getLowercase(paramCommandBuffer[iParamCmd]->evaluation_.getOriginalCommand())
-                == getLowercase(commandStr))
-            {
-              // already in list
-              cmd->paramCommand_ = paramCommandBuffer[iParamCmd];
-              break;
-            }
-          }
-          if (cmd->paramCommand_ == 0)
-          {
-            cmd->paramCommand_ = new BufferedParamCommand();
-            paramCommandBuffer.push_back(cmd->paramCommand_);
-            cmd->paramCommand_->evaluation_ = eval;
-            cmd->paramCommand_->paramIndex_ = paramIndex;
-          }
-
-
-          // we don't know whether this is an actual axis or just a button
-          if (mode == KeybindMode::None)
-          {
-            if (!addParamCommand(cmd))
-            {
-              mode = eval.getConsoleCommand()->getKeybindMode();
-              commands[mode].push_back(cmd);
-            }
-          }
-        }
-        else
-        {
-          SimpleCommand* cmd = new SimpleCommand();
-          cmd->evaluation_ = eval;
-
-          if (mode == KeybindMode::None)
-            mode = eval.getConsoleCommand()->getKeybindMode();
-
-          commands[mode].push_back(cmd);
-        }
-      }
-    }
-
-    for (unsigned int j = 0; j < 3; j++)
-    {
-      nCommands_[j] = commands[j].size();
-      if (nCommands_[j])
-      {
-        commands_[j] = new BaseCommand*[nCommands_[j]];
-        for (unsigned int i = 0; i < commands[j].size(); i++)
-          commands_[j][i] = commands[j][i];
-      }
-      else
-        commands_[j] = 0;
-    }
-  }
-
-  bool Button::execute(KeybindMode::Enum mode, float abs, float rel)
-  {
-    // execute all the parsed commands in the string
-    for (unsigned int iCommand = 0; iCommand < nCommands_[mode]; iCommand++)
-      commands_[mode][iCommand]->execute(abs, rel);
-    return true;
-  }
-
-  // ###############################
-  // #####      HalfAxis       #####
-  // ###############################
-
-  void HalfAxis::clear()
-  {
-    Button::clear();
-    if (nParamCommands_)
-    {
-      // delete all commands and the command pointer array
-      for (unsigned int i = 0; i < nParamCommands_; i++)
-        delete paramCommands_[i];
-      delete[] paramCommands_;
-      nParamCommands_ = 0;
-    }
-    else
-    {
-      nParamCommands_ = 0; nParamCommands_ = 0;
-    }
-  }
-
-  bool HalfAxis::addParamCommand(ParamCommand* command)
-  {
-    ParamCommand** cmds = paramCommands_;
-    paramCommands_ = new ParamCommand*[++nParamCommands_];
-    unsigned int i;
-    for (i = 0; i < nParamCommands_ - 1; i++)
-      paramCommands_[i] = cmds[i];
-    paramCommands_[i] = command;
-    if (nParamCommands_ > 1)
-      delete[] cmds;
-    return true;
-  }
-
-  bool HalfAxis::execute()
-  {
-    bool success = true;
-    for (unsigned int i = 0; i < nParamCommands_; i++)
-      success = success && paramCommands_[i]->execute(absVal_, relVal_);
-    return success;
-  }
-
-
-  // ###############################
-  // ######     KeyBinder     ######
-  // ###############################
-
-  /**
-    @brief Constructor that does as little as necessary.
-  */
-  KeyBinder::KeyBinder() : deriveTime_(0.0f)
-  {
-    mouseRelative_[0] = 0;
-    mouseRelative_[1] = 0;
-    mousePosition_[0] = 0;
-    mousePosition_[1] = 0;
-
-    RegisterObject(KeyBinder);
-
-    // keys
-    std::string keyNames[] = {
-      "UNASSIGNED",
-      "ESCAPE",
-      "1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
-      "MINUS", "EQUALS", "BACK", "TAB",
-      "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P",
-      "LBRACKET", "RBRACKET",
-      "RETURN", "LCONTROL",
-      "A", "S", "D", "F", "G", "H", "J", "K", "L",
-      "SEMICOLON", "APOSTROPHE", "GRAVE",
-      "LSHIFT", "BACKSLASH",
-      "Z", "X", "C", "V", "B", "N", "M",
-      "COMMA", "PERIOD", "SLASH",
-      "RSHIFT",
-      "MULTIPLY",
-      "LMENU",
-      "SPACE",
-      "CAPITAL",
-      "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10",
-      "NUMLOCK", "SCROLL",
-      "NUMPAD7", "NUMPAD8", "NUMPAD9",
-      "SUBTRACT",
-      "NUMPAD4", "NUMPAD5", "NUMPAD6",
-      "ADD",
-      "NUMPAD1", "NUMPAD2", "NUMPAD3", "NUMPAD0",
-      "DECIMAL",
-      "","",
-      "OEM_102",
-      "F11", "F12",
-      "","","","","","","","","","","",
-      "F13", "F14", "F15",
-      "","","","","","","","","","",
-      "KANA",
-      "","",
-      "ABNT_C1",
-      "","","","","",
-      "CONVERT",
-      "",
-      "NOCONVERT",
-      "",
-      "YEN",
-      "ABNT_C2",
-      "","","","","","","","","","","","","","",
-      "NUMPADEQUALS",
-      "","",
-      "PREVTRACK",
-      "AT",
-      "COLON", "UNDERLINE",
-      "KANJI",
-      "STOP",
-      "AX",
-      "UNLABELED",
-      "NEXTTRACK",
-      "","",
-      "NUMPADENTER",
-      "RCONTROL",
-      "","",
-      "MUTE",
-      "CALCULATOR",
-      "PLAYPAUSE",
-      "",
-      "MEDIASTOP",
-      "","","","","","","","","",
-      "VOLUMEDOWN",
-      "",
-      "VOLUMEUP",
-      "",
-      "WEBHOME",
-      "NUMPADCOMMA",
-      "",
-      "DIVIDE",
-      "",
-      "SYSRQ",
-      "RMENU",
-      "","","","","","","","","","","","",
-      "PAUSE",
-      "",
-      "HOME",
-      "UP",
-      "PGUP",
-      "",
-      "LEFT",
-      "",
-      "RIGHT",
-      "",
-      "END", "DOWN", "PGDOWN", "INSERT", "DELETE",
-      "","","","","","","",
-      "LWIN", "RWIN", "APPS",
-      "POWER", "SLEEP",
-      "","","",
-      "WAKE",
-      "",
-      "WEBSEARCH", "WEBFAVORITES", "WEBREFRESH", "WEBSTOP", "WEBFORWARD", "WEBBACK",
-      "MYCOMPUTER", "MAIL", "MEDIASELECT"
-    };
-    for (unsigned int i = 0; i < nKeys_s; i++)
-      keys_[i].name_ = "Key" + keyNames[i];
-
-    // mouse buttons
-    std::string mouseButtonNames[] = {
-      "MouseLeft", "MouseRight", "MouseMiddle",
-      "MouseButton3", "MouseButton4", "MouseButton5",
-      "MouseButton6", "MouseButton7",
-      "MouseWheel1Up", "MouseWheel1Down",
-      "MouseWheel2Up", "MouseWheel2Down" };
-    for (unsigned int i = 0; i < nMouseButtons_s; i++)
-      mouseButtons_[i].name_ = mouseButtonNames[i];
-
-    // joy stick buttons
-    for (unsigned int i = 0; i < 32; i++)
-      joyStickButtons_[i].name_ = "JoyButton" + getConvertedValue<int, std::string>(i);
-    for (unsigned int i = 32; i < nJoyStickButtons_s; i += 4)
-    {
-		  joyStickButtons_[i + 0].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "North";
-		  joyStickButtons_[i + 1].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "South";
-		  joyStickButtons_[i + 2].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "East";
-		  joyStickButtons_[i + 3].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "West";
-    }
-
-    // half axes
-    std::string rawNames[nHalfAxes_s/2];
-    rawNames[0] = "MouseX";
-    rawNames[1] = "MouseY";
-    rawNames[2] = "Empty1";
-    rawNames[3] = "Empty2";
-    for (unsigned int i = 4; i < nHalfAxes_s/2; i++)
-      rawNames[i] = "JoyAxis" + getConvertedValue<int, std::string>(i - 3);
-    for (unsigned int i = 0; i < nHalfAxes_s/2; i++)
-    {
-      halfAxes_[i * 2 + 0].name_ = rawNames[i] + "Pos";
-      halfAxes_[i * 2 + 1].name_ = rawNames[i] + "Neg";
-    }
-
-    for (unsigned int i = 0; i < this->nHalfAxes_s; i++)
-      halfAxes_[i].buttonThreshold_ = buttonThreshold_;
-  }
-
-  /**
-    @brief Destructor
-  */
-  KeyBinder::~KeyBinder()
-  {
-    // almost no destructors required because most of the arrays are static.
-    clearBindings(); // does some destruction work
-  }
-
-  /**
-    @brief Loads the key and button bindings.
-    @return True if loading succeeded.
-  */
-  void KeyBinder::loadBindings()
-  {
-    COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
-
-    clearBindings();
-
-    std::ifstream infile;
-    infile.open("keybindings.ini");
-    if (!infile.is_open())
-    {
-      ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "def_keybindings.ini");
-      ConfigFileManager::getSingleton()->save(CFT_Keybindings, "keybindings.ini");
-    }
-    infile.close();
-    ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini");
-
-    // parse key bindings
-    setConfigValues();
-
-    COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
-  }
-
-  /**
-    @brief Loader for the key bindings, managed by config values.
-  */
-  void KeyBinder::setConfigValues()
-  {
-    SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.01f)  .description("Threshold for analog axes until which the state is 0.");
-    SetConfigValueGeneric(KeyBinder, mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
-    SetConfigValueGeneric(KeyBinder, bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
-    SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.5f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
-    SetConfigValueGeneric(KeyBinder, mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
-    SetConfigValueGeneric(KeyBinder, bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
-
-    float oldThresh = buttonThreshold_;
-    SetConfigValueGeneric(KeyBinder, buttonThreshold_, 0.80f).description("Threshold for analog axes until which the button is not pressed.");
-    if (oldThresh != buttonThreshold_)
-      for (unsigned int i = 0; i < nHalfAxes_s; i++)
-        if (halfAxes_[i].buttonThreshold_ == oldThresh)
-          halfAxes_[i].buttonThreshold_ = buttonThreshold_;
-
-    // keys
-    for (unsigned int i = 0; i < nKeys_s; i++)
-      readTrigger(keys_[i]);
-    // mouse buttons
-    for (unsigned int i = 0; i < nMouseButtons_s; i++)
-      readTrigger(mouseButtons_[i]);
-    // joy stick buttons
-    for (unsigned int i = 0; i < nJoyStickButtons_s; i++)
-      readTrigger(joyStickButtons_[i]);
-    // half axes
-    for (unsigned int i = 0; i < nHalfAxes_s; i++)
-      readTrigger(halfAxes_[i]);
-  }
-
-  void KeyBinder::readTrigger(Button& button)
-  {
-    // config value stuff
-    ConfigValueContainer* cont = ClassManager<KeyBinder>::getIdentifier()->getConfigValueContainer(button.name_);
-    if (!cont)
-    {
-      cont = new ConfigValueContainer(CFT_Keybindings, ClassManager<KeyBinder>::getIdentifier(), button.name_, "");
-      ClassManager<KeyBinder>::getIdentifier()->addConfigValueContainer(button.name_, cont);
-    }
-    std::string old = button.bindingString_;
-    cont->getValue(&button.bindingString_);
-
-    // keybinder stuff
-    if (old != button.bindingString_)
-    {
-      // clear everything so we don't get old axis ParamCommands mixed up
-      button.clear();
-
-      // binding has changed
-      button.parse(paramCommandBuffer_);
-    }
-  }
-
-  /**
-    @brief Overwrites all bindings with ""
-  */
-  void KeyBinder::clearBindings()
-  {
-    for (unsigned int i = 0; i < nKeys_s; i++)
-      keys_[i].clear();
-
-    for (unsigned int i = 0; i < nMouseButtons_s; i++)
-      mouseButtons_[i].clear();
-
-    for (unsigned int i = 0; i < nJoyStickButtons_s; i++)
-      joyStickButtons_[i].clear();
-
-    for (unsigned int i = 0; i < nHalfAxes_s; i++)
-      halfAxes_[i].clear();
-
-    for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
-      delete paramCommandBuffer_[i];
-    paramCommandBuffer_.clear();
-  }
-
-  void KeyBinder::resetJoyStickAxes()
-  {
-    for (unsigned int i = 8; i < nHalfAxes_s; i++)
-    {
-      halfAxes_[i].absVal_ = 0.0f;
-      halfAxes_[i].relVal_ = 0.0f;
-    }
-  }
-
-  void KeyBinder::tickInput(float dt, const HandlerState& state)
-  {
-    // we have to process all the analog input since there is e.g. no 'mouseDoesntMove' event.
-    unsigned int iBegin = 8;
-    unsigned int iEnd   = 8;
-    if (state.joyStick)
-      iEnd = nHalfAxes_s;
-    if (state.mouse)
-      iBegin = 0;
-    for (unsigned int i = iBegin; i < iEnd; i++)
-    {
-      if (halfAxes_[i].hasChanged_)
-      {
-        if (!halfAxes_[i].wasDown_ && halfAxes_[i].absVal_ > halfAxes_[i].buttonThreshold_)
-        {
-          halfAxes_[i].wasDown_ = true;
-          if (halfAxes_[i].nCommands_[KeybindMode::OnPress])
-            halfAxes_[i].execute(KeybindMode::OnPress);
-        }
-        else if (halfAxes_[i].wasDown_ && halfAxes_[i].absVal_ < halfAxes_[i].buttonThreshold_)
-        {
-          halfAxes_[i].wasDown_ = false;
-          if (halfAxes_[i].nCommands_[KeybindMode::OnRelease])
-            halfAxes_[i].execute(KeybindMode::OnRelease);
-        }
-        halfAxes_[i].hasChanged_ = false;
-      }
-
-      if (halfAxes_[i].wasDown_)
-      {
-        if (halfAxes_[i].nCommands_[KeybindMode::OnHold])
-          halfAxes_[i].execute(KeybindMode::OnHold);
-      }
-
-      // these are the actually useful axis bindings for analog input AND output
-      if (halfAxes_[i].relVal_ > analogThreshold_ || halfAxes_[i].absVal_ > analogThreshold_)
-      {
-        //COUT(3) << halfAxes_[i].name_ << "\t" << halfAxes_[i].absVal_ << std::endl;
-        halfAxes_[i].execute();
-      }
-    }
-
-    if (bDeriveMouseInput_ && state.mouse)
-    {
-      if (deriveTime_ > derivePeriod_)
-      {
-        //CCOUT(3) << "mouse abs: ";
-        for (int i = 0; i < 2; i++)
-        {
-          if (mouseRelative_[i] > 0)
-          {
-            halfAxes_[2*i + 0].absVal_ =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
-            halfAxes_[2*i + 1].absVal_ = 0.0f;
-          }
-          else if (mouseRelative_[i] < 0)
-          {
-            halfAxes_[2*i + 0].absVal_ = 0.0f;
-            halfAxes_[2*i + 1].absVal_ = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
-          }
-          else
-          {
-            halfAxes_[2*i + 0].absVal_ = 0.0f;
-            halfAxes_[2*i + 1].absVal_ = 0.0f;
-          }
-          //COUT(3) << mouseRelative_[i] << " | ";
-          mouseRelative_[i] = 0;
-          halfAxes_[2*i + 0].hasChanged_ = true;
-          halfAxes_[2*i + 1].hasChanged_ = true;
-        }
-        deriveTime_ = 0.0f;
-        //COUT(3) << std::endl;
-      }
-      else
-        deriveTime_ += dt;
-    }
-
-    // execute all buffered bindings (addional parameter)
-    for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
-      paramCommandBuffer_[i]->execute();
-
-    // always reset the relative movement of the mouse
-    if (state.mouse)
-      for (unsigned int i = 0; i < 8; i++)
-        halfAxes_[i].relVal_ = 0.0f;
-  }
-
-  void KeyBinder::keyPressed (const KeyEvent& evt)
-  { keys_[evt.key].execute(KeybindMode::OnPress); }
-
-  void KeyBinder::keyReleased(const KeyEvent& evt)
-  { keys_[evt.key].execute(KeybindMode::OnRelease); }
-
-  void KeyBinder::keyHeld    (const KeyEvent& evt)
-  { keys_[evt.key].execute(KeybindMode::OnHold); }
-
-
-  void KeyBinder::mouseButtonPressed (MouseButton::Enum id)
-  { mouseButtons_[id].execute(KeybindMode::OnPress); }
-
-  void KeyBinder::mouseButtonReleased(MouseButton::Enum id)
-  { mouseButtons_[id].execute(KeybindMode::OnRelease); }
-
-  void KeyBinder::mouseButtonHeld    (MouseButton::Enum id)
-  { mouseButtons_[id].execute(KeybindMode::OnHold); }
-
-
-  void KeyBinder::joyStickButtonPressed (int joyStickID, int button)
-  { joyStickButtons_[button].execute(KeybindMode::OnPress); }
-
-  void KeyBinder::joyStickButtonReleased(int joyStickID, int button)
-  { joyStickButtons_[button].execute(KeybindMode::OnRelease); }
-
-  void KeyBinder::joyStickButtonHeld    (int joyStickID, int button)
-  { joyStickButtons_[button].execute(KeybindMode::OnHold); }
-
-  /**
-    @brief Event handler for the mouseMoved Event.
-    @param e Mouse state information
-  */
-  void KeyBinder::mouseMoved(IntVector2 abs_, IntVector2 rel_, IntVector2 clippingSize)
-  {
-    // y axis of mouse input is inverted
-    int rel[] = { rel_.x, -rel_.y };
-
-    if (!bDeriveMouseInput_)
-    {
-      for (int i = 0; i < 2; i++)
-      {
-        if (rel[i])
-        {
-          // absolute
-          halfAxes_[2*i + 0].hasChanged_ = true;
-          halfAxes_[2*i + 1].hasChanged_ = true;
-          mousePosition_[i] += rel[i];
-
-          if (bClipMouse_)
-          {
-            if (mousePosition_[i] > 1024)
-              mousePosition_[i] =  1024;
-            if (mousePosition_[i] < -1024)
-              mousePosition_[i] = -1024;
-          }
-
-          if (mousePosition_[i] >= 0)
-          {
-            halfAxes_[2*i + 0].absVal_ =   mousePosition_[i]/1024.0f * mouseSensitivity_;
-            halfAxes_[2*i + 1].absVal_ =  0.0f;
-          }
-          else
-          {
-            halfAxes_[2*i + 0].absVal_ =  0.0f;
-            halfAxes_[2*i + 1].absVal_ =  -mousePosition_[i]/1024.0f * mouseSensitivity_;
-          }
-        }
-      }
-    }
-    else
-    {
-      mouseRelative_[0] += rel[0];
-      mouseRelative_[1] += rel[1];
-    }
-
-    // relative
-    for (int i = 0; i < 2; i++)
-    {
-      if (rel[i] > 0)
-        halfAxes_[0 + 2*i].relVal_ =  ((float)rel[i])/1024 * mouseSensitivity_;
-      else
-        halfAxes_[1 + 2*i].relVal_ = -((float)rel[i])/1024 * mouseSensitivity_;
-    }
-  }
-
-  /**
-    @brief Event handler for the mouseScrolled Event.
-    @param e Mouse state information
-  */
-  void KeyBinder::mouseScrolled(int abs, int rel)
-  {
-    //COUT(3) << mouseButtons_[8].name_ << "   " << abs << " | " << rel << std::endl;
-
-    if (rel > 0)
-      for (int i = 0; i < rel/120; i++)
-        mouseButtons_[8].execute(KeybindMode::OnPress, ((float)abs)/120.0f);
-    else
-      for (int i = 0; i < -rel/120; i++)
-        mouseButtons_[9].execute(KeybindMode::OnPress, ((float)abs)/120.0f);
-  }
-
-  void KeyBinder::joyStickAxisMoved(int joyStickID, int axis, float value)
-  {
-    // TODO: Use proper calibration values instead of generally 16-bit integer
-    int i = 8 + axis * 2;
-    if (value >= 0)
-    {
-      //if (value > 10000)
-      //{ CCOUT(3) << halfAxes_[i].name_ << std::endl; }
-
-      halfAxes_[i].absVal_ = value;
-      halfAxes_[i].relVal_ = value;
-      halfAxes_[i].hasChanged_ = true;
-      if (halfAxes_[i + 1].absVal_ > 0.0f)
-      {
-        halfAxes_[i + 1].absVal_ = -0.0f;
-        halfAxes_[i + 1].relVal_ = -0.0f;
-        halfAxes_[i + 1].hasChanged_ = true;
-      }
-    }
-    else
-    {
-      //if (value < -10000)
-      //{ CCOUT(3) << halfAxes_[i + 1].name_ << std::endl; }
-
-      halfAxes_[i + 1].absVal_ = -value;
-      halfAxes_[i + 1].relVal_ = -value;
-      halfAxes_[i + 1].hasChanged_ = true;
-      if (halfAxes_[i].absVal_ > 0.0f)
-      {
-        halfAxes_[i].absVal_ = -0.0f;
-        halfAxes_[i].relVal_ = -0.0f;
-        halfAxes_[i].hasChanged_ = true;
-      }
-    }
-  }
-
-
-  // ###############################
-  // #####     KeyDetector     #####
-  // ###############################
-
-  /**
-    @brief Constructor
-  */
-  KeyDetector::KeyDetector()
-  {
-    RegisterObject(KeyDetector);
-  }
-
-  /**
-    @brief Destructor
-  */
-  KeyDetector::~KeyDetector()
-  {
-  }
-
-  /**
-    @brief Loads the key and button bindings.
-    @return True if loading succeeded.
-  */
-  void KeyDetector::loadBindings()
-  {
-    clearBindings();
-    setConfigValues();
-  }
-
-  void KeyDetector::readTrigger(Button& button)
-  {
-    SimpleCommand* cmd = new SimpleCommand();
-    cmd->evaluation_ = CommandExecutor::evaluate("storeKeyStroke " + button.name_);
-    button.commands_[KeybindMode::OnPress] = new BaseCommand*[1];
-    button.commands_[KeybindMode::OnPress][0] = cmd;
-    button.nCommands_[KeybindMode::OnPress] = 1;
-  }
-
-
-  // ###############################
-  // ##### CalibratorCallback  #####
-  // ###############################
-
-  void CalibratorCallback::keyPressed(const orxonox::KeyEvent &evt)
-  {
-    if (evt.key == KeyCode::Return)
-    {
-      InputManager::setInputState(InputManager::IS_NOCALIBRATE);
-    }
-  }
-}
Index: de/trunk/src/core/KeyBinder.h
===================================================================
--- /code/trunk/src/core/KeyBinder.h	(revision 1534)
+++ 	(revision )
@@ -1,259 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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 Different definitions of input processing.
- */
-
-#ifndef _KeyBinder_H__
-#define _KeyBinder_H__
-
-#include "CorePrereqs.h"
-
-#include <string>
-#include <vector>
-
-#include "ois/OIS.h"
-#include "util/Math.h"
-#include "OrxonoxClass.h"
-#include "CommandEvaluation.h"
-#include "InputInterfaces.h"
-
-namespace orxonox
-{
-  class _CoreExport BufferedParamCommand
-  {
-  public:
-    BufferedParamCommand() : value_(0.0f), nValuesAdded_(0), paramIndex_(-1) { }
-    bool execute();
-
-    float value_;
-    unsigned int nValuesAdded_;
-    int paramIndex_;
-    CommandEvaluation evaluation_;
-  };
-
-  class _CoreExport BaseCommand
-  {
-  public:
-    virtual ~BaseCommand() { }
-    virtual bool execute(float abs = 1.0f, float rel = 1.0f) = 0;
-  };
-
-  class _CoreExport SimpleCommand : public BaseCommand
-  {
-  public:
-    bool execute(float abs = 1.0f, float rel = 1.0f);
-
-    CommandEvaluation evaluation_;
-  };
-
-  class _CoreExport ParamCommand : public BaseCommand
-  {
-  public:
-    ParamCommand() : bRelative_(false), paramModifier_(1.0f), paramCommand_(0) { }
-    bool execute(float abs = 1.0f, float rel = 1.0f);
-
-    bool bRelative_;
-    float paramModifier_;
-    BufferedParamCommand* paramCommand_;
-  };
-
-  class _CoreExport Button
-  {
-  public:
-    Button() { nCommands_[0]=0; nCommands_[1]=0; nCommands_[2]=0; clear(); }
-    virtual ~Button() { clear(); }
-    virtual void clear();
-    virtual bool addParamCommand(ParamCommand* command) { return false; }
-    void parse(std::vector<BufferedParamCommand*>& paramCommandBuffer);
-    bool execute(KeybindMode::Enum mode, float abs = 1.0f, float rel = 1.0f);
-
-    //! The configured string value
-    std::string bindingString_;
-    //! Name of the trigger as strings
-    std::string name_;
-    //! Basic commands for OnPress, OnHold and OnRelease
-    BaseCommand** commands_[3];
-    //! Number of basic commands
-    unsigned int nCommands_[3];
-    //! Says how much it takes for an analog axis to trigger a button
-    //! Note: This variable is here to have only one parse() function.
-    float buttonThreshold_;
-  };
-
-
-  class _CoreExport HalfAxis : public Button
-  {
-  public:
-    HalfAxis() : relVal_(0.0f), absVal_(0.0f), paramCommands_(0), nParamCommands_(0),
-                 wasDown_(false), hasChanged_(false) { }
-    using Button::execute;
-    bool execute();
-    //bool execute(KeybindMode::Enum mode) { return Button::execute(mode); }
-    bool addParamCommand(ParamCommand* command);
-    void clear();
-
-    // axis related
-    float relVal_;
-    float absVal_;
-    ParamCommand** paramCommands_;
-    unsigned int nParamCommands_;
-
-    // button related
-    bool wasDown_;
-    bool hasChanged_;
-  };
-
-
-  /**
-    @brief Handles mouse, keyboard and joy stick input while in the actual game mode.
-           Manages the key bindings.
-  */
-  class _CoreExport KeyBinder : public KeyHandler, public MouseHandler, public JoyStickHandler, public OrxonoxClass
-  {
-  public:
-    KeyBinder ();
-    virtual ~KeyBinder();
-
-    void loadBindings();
-    void clearBindings();
-    void setConfigValues();
-    void resetJoyStickAxes();
-
-  protected: // functions
-    void tickInput(float dt, const HandlerState& state);
-
-    virtual void readTrigger(Button& button);
-
-    void keyPressed (const KeyEvent& evt);
-    void keyReleased(const KeyEvent& evt);
-    void keyHeld    (const KeyEvent& evt);
-
-    void mouseButtonPressed (MouseButton::Enum id);
-    void mouseButtonReleased(MouseButton::Enum id);
-    void mouseButtonHeld    (MouseButton::Enum id);
-    void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
-    void mouseScrolled      (int abs, int rel);
-
-    void joyStickButtonPressed (int joyStickID, int button);
-    void joyStickButtonReleased(int joyStickID, int button);
-    void joyStickButtonHeld    (int joyStickID, int button);
-    void joyStickAxisMoved     (int joyStickID, int axis, float value);
-
-  protected: // variables
-    //! denotes the number of different keys there are in OIS.
-    static const unsigned int nKeys_s = 0xEE;
-    //! Actual key bindings as bundle for Press, Hold and Release
-    Button keys_ [nKeys_s];
-
-    //! denotes the number of different mouse buttons there are in OIS.
-    static const unsigned int nMouseButtons_s = 8 + 2*2; // 8 buttons and 2 scroll wheels
-    //! Actual key bindings as bundle for Press, Hold and Release
-    Button mouseButtons_ [nMouseButtons_s];
-
-    //! denotes the number of different joy stick buttons there are in OIS.
-    static const unsigned int nJoyStickButtons_s = 32 + 4 * 4; // 32 buttons and 4 POVs with 4 buttons
-    //! Actual key bindings as bundle for Press, Hold and Release
-    Button joyStickButtons_ [nJoyStickButtons_s];
-
-    //! denotes the number of half axes (every axis twice) there can be.
-    static const unsigned int nHalfAxes_s = 56;
-    /**
-    * Array with all the half axes for mouse and joy sticks.
-    * Keep in mind that the positions are fixed and that the first entry is the
-    * positive one and the second is negative.
-    * Sequence is as follows:
-    *  0 -  3: Mouse x and y
-    *  4 -  7: empty
-    *  8 - 23: joy stick slider axes 1 to 8
-    * 24 - 55: joy stick axes 1 - 16
-    */
-    HalfAxis halfAxes_[nHalfAxes_s];
-
-    /**
-    * Commands that have additional parameters (axes) are executed at the end of
-    * the tick() so that all values can be buffered for single execution.
-    */
-    std::vector<BufferedParamCommand*> paramCommandBuffer_;
-
-    //! Keeps track of the absolute mouse value (incl. scroll wheel)
-    int mousePosition_[2];
-    //! Used to derive mouse input if requested
-    int mouseRelative_[2];
-    float deriveTime_;
-
-    //##### ConfigValues #####
-    //! Threshold for analog triggers until which the state is 0.
-    float analogThreshold_;
-    //! Threshold for analog triggers until which the button is not pressed.
-    float buttonThreshold_;
-    //! Derive mouse input for absolute values?
-    bool bDeriveMouseInput_;
-    //! Accuracy of the mouse input deriver. The higher the more precise, but laggier.
-    float derivePeriod_;
-    //! mouse sensitivity
-    float mouseSensitivity_;
-    //! mouse sensitivity if mouse input is derived
-    float mouseSensitivityDerived_;
-    //! Whether or not to clip abslute mouse values to 1024
-    bool bClipMouse_;
-  };
-
-
-  class _CoreExport KeyDetector : public KeyBinder
-  {
-  public:
-    KeyDetector();
-    ~KeyDetector();
-    void loadBindings();
-
-  protected:
-    void readTrigger(Button& button);
-  };
-
-  class _CoreExport CalibratorCallback : public KeyHandler
-  {
-  public:
-    CalibratorCallback() {}
-    ~CalibratorCallback() {}
-
-  private:
-    void keyPressed (const KeyEvent& evt);
-    void keyReleased(const KeyEvent& evt) {}
-    void keyHeld    (const KeyEvent& evt) {}
-
-    void tickInput(float dt, const HandlerState &state) { }
-  };
-}
-
-
-
-
-#endif /* _KeyBinder_H__ */
Index: /code/trunk/src/core/Language.cc
===================================================================
--- /code/trunk/src/core/Language.cc	(revision 1534)
+++ /code/trunk/src/core/Language.cc	(revision 1535)
@@ -36,5 +36,5 @@
 #include <fstream>
 
-#include "CoreSettings.h"
+#include "Core.h"
 
 #include "Debug.h"
@@ -245,15 +245,15 @@
     void Language::readTranslatedLanguageFile()
     {
-        COUT(4) << "Read translated language file (" << CoreSettings::getLanguage() << ")." << std::endl;
+        COUT(4) << "Read translated language file (" << Core::getLanguage() << ")." << std::endl;
 
         // Open the file
         std::ifstream file;
-        file.open(getFileName(CoreSettings::getLanguage()).c_str(), std::fstream::in);
+        file.open(getFileName(Core::getLanguage()).c_str(), std::fstream::in);
 
         if (!file.is_open())
         {
             COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFileName(CoreSettings::getLanguage()) << " to read the translated language entries!" << std::endl;
-            CoreSettings::resetLanguage();
+            COUT(1) << "Error: Couldn't open file " << getFileName(Core::getLanguage()) << " to read the translated language entries!" << std::endl;
+            Core::resetLanguage();
             COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << "." << std::endl;
             return;
@@ -286,5 +286,5 @@
                 else
                 {
-                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFileName(CoreSettings::getLanguage()) << std::endl;
+                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFileName(Core::getLanguage()) << std::endl;
                 }
             }
Index: /code/trunk/src/core/Language.h
===================================================================
--- /code/trunk/src/core/Language.h	(revision 1534)
+++ /code/trunk/src/core/Language.h	(revision 1535)
@@ -113,5 +113,5 @@
     class _CoreExport Language
     {
-        friend class CoreSettings;
+        friend class Core;
 
         public:
Index: /code/trunk/src/core/OutputHandler.cc
===================================================================
--- /code/trunk/src/core/OutputHandler.cc	(revision 1534)
+++ /code/trunk/src/core/OutputHandler.cc	(revision 1535)
@@ -33,5 +33,5 @@
 
 #include "OutputHandler.h"
-#include "CoreSettings.h"
+#include "Core.h"
 #include "ConsoleCommand.h"
 #include "Shell.h"
@@ -83,5 +83,5 @@
     int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device)
     {
-        return CoreSettings::getSoftDebugLevel(device);
+        return Core::getSoftDebugLevel(device);
     }
 
Index: /code/trunk/src/core/Shell.cc
===================================================================
--- /code/trunk/src/core/Shell.cc	(revision 1534)
+++ /code/trunk/src/core/Shell.cc	(revision 1535)
@@ -31,7 +31,7 @@
 #include "CoreIncludes.h"
 #include "ConfigValueIncludes.h"
-#include "CoreSettings.h"
+#include "Core.h"
 #include "ConsoleCommand.h"
-#include "InputInterfaces.h"
+#include "input/InputInterfaces.h"
 
 #define SHELL_UPDATE_LISTENERS(function) \
@@ -67,8 +67,8 @@
     Shell& Shell::createShell()
     {
-        int level = CoreSettings::getSoftDebugLevel(OutputHandler::LD_Shell);
-        CoreSettings::setSoftDebugLevel(OutputHandler::LD_Shell, -1);
+        int level = Core::getSoftDebugLevel(OutputHandler::LD_Shell);
+        Core::setSoftDebugLevel(OutputHandler::LD_Shell, -1);
         static Shell instance;
-        CoreSettings::setSoftDebugLevel(OutputHandler::LD_Shell, level);
+        Core::setSoftDebugLevel(OutputHandler::LD_Shell, level);
         return instance;
     }
Index: /code/trunk/src/core/Shell.h
===================================================================
--- /code/trunk/src/core/Shell.h	(revision 1534)
+++ /code/trunk/src/core/Shell.h	(revision 1535)
@@ -36,5 +36,5 @@
 
 #include "OrxonoxClass.h"
-#include "InputBuffer.h"
+#include "input/InputBuffer.h"
 #include "OutputBuffer.h"
 
Index: /code/trunk/src/core/TclThreadManager.h
===================================================================
--- /code/trunk/src/core/TclThreadManager.h	(revision 1534)
+++ /code/trunk/src/core/TclThreadManager.h	(revision 1535)
@@ -30,4 +30,6 @@
 #define _TclThreadManager_H__
 
+#include "CorePrereqs.h"
+
 #include <queue>
 #include <map>
@@ -38,7 +40,6 @@
 #include <boost/thread/thread.hpp>
 
-#include "CorePrereqs.h"
-#include "Tickable.h"
 #include "cpptcl/CppTcl.h"
+#include "core/OrxonoxClass.h"
 
 namespace orxonox
@@ -68,5 +69,5 @@
     };
 
-    class _CoreExport TclThreadManager : public Tickable
+    class _CoreExport TclThreadManager : public OrxonoxClass
     {
         public:
Index: de/trunk/src/core/Tickable.cc
===================================================================
--- /code/trunk/src/core/Tickable.cc	(revision 1534)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "Tickable.h"
-#include "CoreIncludes.h"
-#include "ConsoleCommand.h"
-
-namespace orxonox
-{
-    /**
-        @brief Constructor: Registers the object in the Tickable-list
-    */
-    Tickable::Tickable()
-    {
-        RegisterRootObject(Tickable);
-    }
-
-    /**
-        @brief Constructor: Registers the object in the TickableReal-list
-    */
-    TickableReal::TickableReal()
-    {
-        RegisterRootObject(TickableReal);
-    }
-}
Index: de/trunk/src/core/Tickable.h
===================================================================
--- /code/trunk/src/core/Tickable.h	(revision 1534)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/*!
-    @file Tickable.h
-    @brief Definition of the Tickable interface.
-
-    The Tickable interface provides a tick(dt) function, that gets called every frame.
-    float dt is the time since the last frame in seconds.
-
-    Attention:
-    Classes derived from a Tickable that want to have a tick(dt) function on their part, MUST call the
-    parent::tick(dt) function explicitly in their implementation of tick(dt) because it's a virtual function.
-*/
-
-#ifndef _Tickable_H__
-#define _Tickable_H__
-
-#include "CorePrereqs.h"
-
-#include "OrxonoxClass.h"
-
-namespace orxonox
-{
-    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
-    class _CoreExport Tickable : virtual public OrxonoxClass
-    {
-        public:
-            /**
-                @brief Gets called every frame.
-                @param dt The time since the last frame in seconds
-            */
-            virtual void tick(float dt) = 0;
-
-        protected:
-            Tickable();
-    };
-
-    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
-    class _CoreExport TickableReal : virtual public OrxonoxClass
-    {
-        public:
-            /**
-                @brief Gets called every frame.
-                @param dt The time since the last frame in seconds
-            */
-            virtual void tick(float dt) = 0;
-
-        protected:
-            TickableReal();
-    };
-
-}
-
-#endif /* _Tickable_H__ */
Index: /code/trunk/src/core/input/Button.cc
===================================================================
--- /code/trunk/src/core/input/Button.cc	(revision 1535)
+++ /code/trunk/src/core/input/Button.cc	(revision 1535)
@@ -0,0 +1,215 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the different input handlers.
+ */
+
+#include "Button.h"
+#include "util/Convert.h"
+#include "util/SubString.h"
+#include "util/String.h"
+#include "core/Debug.h"
+#include "core/ConsoleCommand.h"
+#include "core/CommandEvaluation.h"
+#include "core/CommandExecutor.h"
+#include "InputCommands.h"
+
+namespace orxonox
+{
+  void Button::clear()
+  {
+    for (unsigned int j = 0; j < 3; j++)
+    {
+      if (nCommands_[j])
+      {
+        // delete all commands and the command pointer array
+        for (unsigned int i = 0; i < nCommands_[j]; i++)
+          delete commands_[j][i];
+        delete[] commands_[j];
+        commands_[j] = 0;
+        nCommands_[j] = 0;
+      }
+      else
+      {
+        commands_[j] = 0;
+      }
+    }
+  }
+
+  void Button::parse(std::vector<BufferedParamCommand*>& paramCommandBuffer)
+  {
+    if (isEmpty(bindingString_))
+    {
+      clear();
+      return;
+    }
+
+    // use std::vector for a temporary dynamic array
+    std::vector<BaseCommand*> commands[3];
+
+
+    // separate the commands
+    SubString commandStrings(bindingString_, "|", SubString::WhiteSpaces, false,
+        '\\', false, '"', false, '(', ')', false, '\0');
+
+    for (unsigned int iCommand = 0; iCommand < commandStrings.size(); iCommand++)
+    {
+      if (commandStrings[iCommand] != "")
+      {
+        SubString tokens(commandStrings[iCommand], " ", SubString::WhiteSpaces, false,
+            '\\', false, '"', false, '(', ')', false, '\0');
+
+        unsigned int iToken = 0;
+
+        // for real axes, we can feed a ButtonThreshold argument as entire command
+        if (getLowercase(tokens[0]) == "buttonthreshold")
+        {
+          if (tokens.size() == 1)
+            continue;
+          // may fail, but doesn't matter
+          convertValue(&buttonThreshold_, tokens[1]);
+          continue;
+        }
+
+        // first argument can be OnPress, OnHold OnRelease or nothing
+        KeybindMode::Enum mode = KeybindMode::None;
+        if (getLowercase(tokens[iToken]) == "onpress")
+          mode = KeybindMode::OnPress,   iToken++;
+        if (getLowercase(tokens[iToken]) == "onrelease")
+          mode = KeybindMode::OnRelease, iToken++;
+        if (getLowercase(tokens[iToken]) == "onhold")
+          mode = KeybindMode::OnHold,    iToken++;
+
+        if (iToken == tokens.size())
+          continue;
+
+        // second argument can be the amplitude for the case it as an axis command
+        // default amplitude is 1.0f
+        float paramModifier = 1.0f;
+        if (getLowercase(tokens[iToken]) == "scale")
+        {
+          iToken++;
+          if (iToken == tokens.size() || !convertValue(&paramModifier, tokens[iToken]))
+          {
+            COUT(2) << "Error while parsing key binding " << name_
+                << ". Numeric expression expected afer 'AxisAmp', switching to default value" << std::endl;
+            if (iToken == tokens.size())
+              continue;
+          }
+          iToken++;
+        }
+
+        // no more arguments expected except for the actual command
+        if (iToken == tokens.size())
+          continue;
+
+        std::string commandStr;
+        while (iToken != tokens.size())
+          commandStr += tokens[iToken++] + " ";
+
+        // evaluate the command
+        CommandEvaluation eval = CommandExecutor::evaluate(commandStr);
+        if (!eval.isValid())
+          continue;
+
+        // check for param command
+        int paramIndex = eval.getConsoleCommand()->getAxisParamIndex();
+        if (paramIndex >= 0)
+        {
+          // parameter supported command
+          ParamCommand* cmd = new ParamCommand();
+          cmd->paramModifier_ = paramModifier;
+          cmd->bRelative_ = eval.getConsoleCommand()->getIsAxisRelative();
+
+          // add command to the buffer if not yet existing
+          for (unsigned int iParamCmd = 0; iParamCmd < paramCommandBuffer.size(); iParamCmd++)
+          {
+            if (getLowercase(paramCommandBuffer[iParamCmd]->evaluation_.getOriginalCommand())
+                == getLowercase(commandStr))
+            {
+              // already in list
+              cmd->paramCommand_ = paramCommandBuffer[iParamCmd];
+              break;
+            }
+          }
+          if (cmd->paramCommand_ == 0)
+          {
+            cmd->paramCommand_ = new BufferedParamCommand();
+            paramCommandBuffer.push_back(cmd->paramCommand_);
+            cmd->paramCommand_->evaluation_ = eval;
+            cmd->paramCommand_->paramIndex_ = paramIndex;
+          }
+
+
+          // we don't know whether this is an actual axis or just a button
+          if (mode == KeybindMode::None)
+          {
+            if (!addParamCommand(cmd))
+            {
+              mode = eval.getConsoleCommand()->getKeybindMode();
+              commands[mode].push_back(cmd);
+            }
+          }
+        }
+        else
+        {
+          SimpleCommand* cmd = new SimpleCommand();
+          cmd->evaluation_ = eval;
+
+          if (mode == KeybindMode::None)
+            mode = eval.getConsoleCommand()->getKeybindMode();
+
+          commands[mode].push_back(cmd);
+        }
+      }
+    }
+
+    for (unsigned int j = 0; j < 3; j++)
+    {
+      nCommands_[j] = commands[j].size();
+      if (nCommands_[j])
+      {
+        commands_[j] = new BaseCommand*[nCommands_[j]];
+        for (unsigned int i = 0; i < commands[j].size(); i++)
+          commands_[j][i] = commands[j][i];
+      }
+      else
+        commands_[j] = 0;
+    }
+  }
+
+  bool Button::execute(KeybindMode::Enum mode, float abs, float rel)
+  {
+    // execute all the parsed commands in the string
+    for (unsigned int iCommand = 0; iCommand < nCommands_[mode]; iCommand++)
+      commands_[mode][iCommand]->execute(abs, rel);
+    return true;
+  }
+}
Index: /code/trunk/src/core/input/Button.h
===================================================================
--- /code/trunk/src/core/input/Button.h	(revision 1535)
+++ /code/trunk/src/core/input/Button.h	(revision 1535)
@@ -0,0 +1,68 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Different definitions of input processing.
+ */
+
+#ifndef _Button_H__
+#define _Button_H__
+
+#include "core/CorePrereqs.h"
+
+#include <string>
+#include <vector>
+
+namespace orxonox
+{
+  class _CoreExport Button
+  {
+  public:
+    Button() { nCommands_[0]=0; nCommands_[1]=0; nCommands_[2]=0; clear(); }
+    virtual ~Button() { clear(); }
+    virtual void clear();
+    virtual bool addParamCommand(ParamCommand* command) { return false; }
+    void parse(std::vector<BufferedParamCommand*>& paramCommandBuffer);
+    bool execute(KeybindMode::Enum mode, float abs = 1.0f, float rel = 1.0f);
+
+    //! The configured string value
+    std::string bindingString_;
+    //! Name of the trigger as strings
+    std::string name_;
+    //! Basic commands for OnPress, OnHold and OnRelease
+    BaseCommand** commands_[3];
+    //! Number of basic commands
+    unsigned int nCommands_[3];
+    //! Says how much it takes for an analog axis to trigger a button
+    //! Note: This variable is here to have only one parse() function.
+    float buttonThreshold_;
+  };
+}
+
+#endif /* _Button_H__ */
Index: /code/trunk/src/core/input/CalibratorCallback.cc
===================================================================
--- /code/trunk/src/core/input/CalibratorCallback.cc	(revision 1535)
+++ /code/trunk/src/core/input/CalibratorCallback.cc	(revision 1535)
@@ -0,0 +1,46 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the different input handlers.
+ */
+
+#include "CalibratorCallback.h"
+#include "InputManager.h"
+
+namespace orxonox
+{
+  void CalibratorCallback::keyPressed(const orxonox::KeyEvent &evt)
+  {
+    if (evt.key == KeyCode::Return)
+    {
+      InputManager::setInputState(InputManager::IS_NOCALIBRATE);
+    }
+  }
+}
Index: /code/trunk/src/core/input/CalibratorCallback.h
===================================================================
--- /code/trunk/src/core/input/CalibratorCallback.h	(revision 1535)
+++ /code/trunk/src/core/input/CalibratorCallback.h	(revision 1535)
@@ -0,0 +1,58 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Different definitions of input processing.
+ */
+
+#ifndef _CalibratorCallback_H__
+#define _CalibratorCallback_H__
+
+#include "core/CorePrereqs.h"
+
+#include "InputInterfaces.h"
+
+namespace orxonox
+{
+  class _CoreExport CalibratorCallback : public KeyHandler
+  {
+  public:
+    CalibratorCallback() {}
+    ~CalibratorCallback() {}
+
+  private:
+    void keyPressed (const KeyEvent& evt);
+    void keyReleased(const KeyEvent& evt) {}
+    void keyHeld    (const KeyEvent& evt) {}
+
+    void tickInput(float dt, const HandlerState &state) { }
+  };
+}
+
+#endif /* _CalibratorCallback_H__ */
Index: /code/trunk/src/core/input/HalfAxis.cc
===================================================================
--- /code/trunk/src/core/input/HalfAxis.cc	(revision 1535)
+++ /code/trunk/src/core/input/HalfAxis.cc	(revision 1535)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the different input handlers.
+ */
+
+#include "HalfAxis.h"
+#include "core/CommandEvaluation.h"
+#include "InputCommands.h"
+
+namespace orxonox
+{
+  void HalfAxis::clear()
+  {
+    Button::clear();
+    if (nParamCommands_)
+    {
+      // delete all commands and the command pointer array
+      for (unsigned int i = 0; i < nParamCommands_; i++)
+        delete paramCommands_[i];
+      delete[] paramCommands_;
+      nParamCommands_ = 0;
+    }
+    else
+    {
+      nParamCommands_ = 0; nParamCommands_ = 0;
+    }
+  }
+
+  bool HalfAxis::addParamCommand(ParamCommand* command)
+  {
+    ParamCommand** cmds = paramCommands_;
+    paramCommands_ = new ParamCommand*[++nParamCommands_];
+    unsigned int i;
+    for (i = 0; i < nParamCommands_ - 1; i++)
+      paramCommands_[i] = cmds[i];
+    paramCommands_[i] = command;
+    if (nParamCommands_ > 1)
+      delete[] cmds;
+    return true;
+  }
+
+  bool HalfAxis::execute()
+  {
+    bool success = true;
+    for (unsigned int i = 0; i < nParamCommands_; i++)
+      success = success && paramCommands_[i]->execute(absVal_, relVal_);
+    return success;
+  }
+}
Index: /code/trunk/src/core/input/HalfAxis.h
===================================================================
--- /code/trunk/src/core/input/HalfAxis.h	(revision 1535)
+++ /code/trunk/src/core/input/HalfAxis.h	(revision 1535)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Different definitions of input processing.
+ */
+
+#ifndef _HalfAxis_H__
+#define _HalfAxis_H__
+
+#include "core/CorePrereqs.h"
+#include "Button.h"
+
+namespace orxonox
+{
+  class _CoreExport HalfAxis : public Button
+  {
+  public:
+    HalfAxis() : relVal_(0.0f), absVal_(0.0f), paramCommands_(0), nParamCommands_(0),
+                 wasDown_(false), hasChanged_(false) { }
+    using Button::execute;
+    bool execute();
+    bool addParamCommand(ParamCommand* command);
+    void clear();
+
+    // axis related
+    float relVal_;
+    float absVal_;
+    ParamCommand** paramCommands_;
+    unsigned int nParamCommands_;
+
+    // button related
+    bool wasDown_;
+    bool hasChanged_;
+  };
+}
+
+#endif /* _HalfAxis_H__ */
Index: /code/trunk/src/core/input/InputBuffer.cc
===================================================================
--- /code/trunk/src/core/input/InputBuffer.cc	(revision 1535)
+++ /code/trunk/src/core/input/InputBuffer.cc	(revision 1535)
@@ -0,0 +1,257 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#include "InputBuffer.h"
+
+#include <iostream>
+
+#include "util/Clipboard.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+
+namespace orxonox
+{
+    InputBuffer::InputBuffer()
+    {
+        RegisterRootObject(InputBuffer);
+
+        this->buffer_ = "";
+        this->cursor_ = 0;
+        this->allowedChars_ = "abcdefghijklmnopqrstuvwxyz \
+                               ABCDEFGHIJKLMNOPQRSTUVWXYZ \
+                               äëïöüÄËÏÖÜáâàéêèíîìóôòúûù \
+                               0123456789 \
+                               \\\"(){}[]<>.:,;_-+*/=!?|$&%^~#";
+
+        this->lastKey_ = KeyCode::Unassigned;
+        this->timeSinceKeyPressed_ = 0.0f;
+        this->timeSinceKeyRepeated_ = 0.0f;
+        this->keysToRepeat_ = 0;
+
+        setConfigValues();
+    }
+
+    InputBuffer::InputBuffer(const std::string allowedChars)
+    {
+        RegisterRootObject(InputBuffer);
+
+        this->allowedChars_ = allowedChars;
+        this->buffer_ = "";
+        this->cursor_ = 0;
+
+        this->lastKey_ = KeyCode::Unassigned;
+        this->timeSinceKeyPressed_ = 0.0f;
+        this->timeSinceKeyRepeated_ = 0.0f;
+        this->keysToRepeat_ = 0;
+
+        setConfigValues();
+    }
+
+    void InputBuffer::setConfigValues()
+    {
+        SetConfigValue(keyRepeatDeleay_, 0.4).description("Key repeat deleay of the input buffer");
+        SetConfigValue(keyRepeatTime_, 0.022).description("Key repeat time of the input buffer");
+
+        if (keyRepeatDeleay_ < 0.0)
+        {
+            ResetConfigValue(keyRepeatDeleay_);
+        }
+        if (keyRepeatTime_ < 0.0)
+        {
+            ResetConfigValue(keyRepeatTime_);
+        }
+    }
+
+    void InputBuffer::set(const std::string& input, bool update)
+    {
+        this->clear(false);
+        this->insert(input, update);
+    }
+
+    void InputBuffer::insert(const std::string& input, bool update)
+    {
+        for (unsigned int i = 0; i < input.size(); ++i)
+        {
+            this->insert(input[i], false);
+
+            if (update)
+                this->updated(input[i], false);
+        }
+
+        if (update)
+            this->updated();
+    }
+
+    void InputBuffer::insert(const char& input, bool update)
+    {
+        if (this->charIsAllowed(input))
+        {
+            this->buffer_.insert(this->cursor_, 1, input);
+            ++this->cursor_;
+        }
+
+        if (update)
+            this->updated(input, true);
+    }
+
+    void InputBuffer::clear(bool update)
+    {
+        this->buffer_ = "";
+        this->cursor_ = 0;
+
+        if (update)
+            this->updated();
+    }
+
+    void InputBuffer::removeBehindCursor(bool update)
+    {
+        if (this->cursor_ > 0)
+        {
+            --this->cursor_;
+            this->buffer_.erase(this->cursor_, 1);
+
+            if (update)
+                this->updated();
+        }
+    }
+
+    void InputBuffer::removeAtCursor(bool update)
+    {
+        if (this->cursor_ < this->buffer_.size())
+        {
+            this->buffer_.erase(this->cursor_, 1);
+
+            if (update)
+                this->updated();
+        }
+    }
+
+    void InputBuffer::updated()
+    {
+        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+        {
+            if ((*it)->bListenToAllChanges_)
+                (*it)->callFunction();
+        }
+    }
+
+    void InputBuffer::updated(const char& update, bool bSingleInput)
+    {
+        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+        {
+            if ((!(*it)->trueKeyFalseChar_) && ((*it)->bListenToAllChanges_ || ((*it)->char_ == update)) && (!(*it)->bOnlySingleInput_ || bSingleInput))
+                (*it)->callFunction();
+        }
+    }
+
+    bool InputBuffer::charIsAllowed(const char& input)
+    {
+        if (this->allowedChars_ == "")
+            return true;
+        else
+            return (this->allowedChars_.find(input) != std::string::npos);
+    }
+
+
+    void InputBuffer::processKey(const KeyEvent &evt)
+    {
+        if (evt.isModifierDown(KeyboardModifier::Alt) && evt.key == KeyCode::Tab)
+            return;
+
+        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+        {
+            if ((*it)->trueKeyFalseChar_ && ((*it)->key_ == evt.key))
+                (*it)->callFunction();
+        }
+
+        if (evt.isModifierDown(KeyboardModifier::Ctrl))
+        {
+            if (evt.key == KeyCode::V)
+                this->insert(fromClipboard());
+            else if (evt.key == KeyCode::C)
+                toClipboard(this->buffer_);
+            else if (evt.key == KeyCode::X)
+            {
+                toClipboard(this->buffer_);
+                this->clear();
+            }
+        }
+        else if (evt.isModifierDown(KeyboardModifier::Shift))
+        {
+            if (evt.key == KeyCode::Insert)
+                this->insert(fromClipboard());
+            else if (evt.key == KeyCode::Delete)
+            {
+                toClipboard(this->buffer_);
+                this->clear();
+            }
+        }
+
+        this->insert((char)evt.text);
+    }
+
+    /**
+        @brief This tick() function is called by the InputManager if the InputBuffer is active.
+        @param dt Delta time
+    */
+    void InputBuffer::tickInput(float dt, const HandlerState& state)
+    {
+        timeSinceKeyPressed_ += dt;
+        if (keysToRepeat_ < 10 && timeSinceKeyPressed_ > keyRepeatDeleay_)
+        {
+            // initial time out has gone by, start repeating keys
+            while (timeSinceKeyPressed_ - timeSinceKeyRepeated_ > keyRepeatTime_)
+            {
+                timeSinceKeyRepeated_ += keyRepeatTime_;
+                keysToRepeat_++;
+            }
+        }
+    }
+
+    void InputBuffer::keyPressed(const KeyEvent &evt)
+    {
+        lastKey_ = evt.key;
+        timeSinceKeyPressed_ = 0.0;
+        timeSinceKeyRepeated_ = keyRepeatDeleay_;
+        keysToRepeat_ = 0;
+
+        processKey(evt);
+    }
+
+    void InputBuffer::keyHeld(const KeyEvent& evt)
+    {
+        if (evt.key == lastKey_)
+        {
+            while (keysToRepeat_)
+            {
+                processKey(evt);
+                keysToRepeat_--;
+            }
+        }
+    }
+}
Index: /code/trunk/src/core/input/InputBuffer.h
===================================================================
--- /code/trunk/src/core/input/InputBuffer.h	(revision 1535)
+++ /code/trunk/src/core/input/InputBuffer.h	(revision 1535)
@@ -0,0 +1,189 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#ifndef _InputBuffer_H__
+#define _InputBuffer_H__
+
+#include "core/CorePrereqs.h"
+
+#include <string>
+#include <list>
+
+#include "core/OrxonoxClass.h"
+#include "InputInterfaces.h"
+
+namespace orxonox
+{
+    class BaseInputBufferListenerTuple
+    {
+    public:
+        BaseInputBufferListenerTuple(bool bListenToAllChanges, bool bOnlySingleInput,
+            bool trueKeyFalseChar, char _char, KeyCode::Enum key)
+            : bListenToAllChanges_(bListenToAllChanges), bOnlySingleInput_(bOnlySingleInput),
+              trueKeyFalseChar_(trueKeyFalseChar), char_(_char), key_(key)
+        { }
+        virtual ~BaseInputBufferListenerTuple() { }
+        virtual void callFunction() = 0;
+        bool bListenToAllChanges_;
+        bool bOnlySingleInput_;
+        bool trueKeyFalseChar_;
+        char char_;
+        KeyCode::Enum key_;
+    };
+
+    template <class T>
+    class InputBufferListenerTuple : public BaseInputBufferListenerTuple
+    {
+    public:
+        InputBufferListenerTuple(T* listener, void (T::*function)(), bool bListenToAllChanges,
+            bool bOnlySingleInput, bool trueKeyFalseChar, char _char, KeyCode::Enum key)
+            : BaseInputBufferListenerTuple(bListenToAllChanges, bOnlySingleInput, trueKeyFalseChar, _char, key),
+              listener_(listener), function_(function)
+        { }
+        virtual ~InputBufferListenerTuple() { }
+        void callFunction()
+        {
+            (listener_->*function_)();
+        }
+        T* listener_;
+        void (T::*function_)();
+    };
+
+    class _CoreExport InputBuffer : public KeyHandler, public OrxonoxClass
+    {
+        public:
+            InputBuffer();
+            InputBuffer(const std::string allowedChars);
+
+            void setConfigValues();
+
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, true, bOnlySingleInput, false, '\0', KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), char _char, bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, char _char, bool bOnlySingleInput)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, bOnlySingleInput, false, _char, KeyCode::Unassigned);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), KeyCode::Enum key)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, KeyCode::Enum key)
+            {
+                InputBufferListenerTuple<T>* newTuple = new InputBufferListenerTuple<T>(listener, (void (T::*)())function, false, true, true, '\0', key);
+                this->listeners_.insert(this->listeners_.end(), newTuple);
+            }
+
+            template <class T>
+            void unregisterListener(T* listener)
+            {
+                for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
+                {
+                    InputBufferListenerTuple<T>* refListener = dynamic_cast<InputBufferListenerTuple<T>*>(*it);
+                    if (refListener && refListener->listener_ == listener)
+                        this->listeners_.erase(it++);
+                    else
+                        it++;
+                }
+            }
+
+            void set(const std::string& input, bool update = true);
+            void insert(const std::string& input, bool update = true);
+            void insert(const char& input, bool update = true);
+            void clear(bool update = true);
+            void removeAtCursor(bool update = true);
+            void removeBehindCursor(bool update = true);
+
+            void updated();
+            void updated(const char& update, bool bSingleInput);
+
+            inline std::string get() const
+                { return this->buffer_; }
+            inline unsigned int getSize() const
+                { return this->buffer_.size(); }
+
+            inline unsigned int getCursorPosition() const
+                { return this->cursor_; }
+            inline void setCursorPosition(unsigned int cursor)
+                { if (cursor <= this->buffer_.size()) { this->cursor_ = cursor; } }
+            inline void setCursorToEnd()
+                { this->cursor_ = this->buffer_.size(); }
+            inline void setCursorToBegin()
+                { this->cursor_ = 0; }
+            inline void increaseCursor()
+                { if (this->cursor_ < this->buffer_.size()) { ++this->cursor_; } }
+            inline void decreaseCursor()
+                { if (this->cursor_ > 0) { --this->cursor_; } }
+
+        private:
+            bool charIsAllowed(const char& input);
+
+            void keyPressed (const KeyEvent& evt);
+            void keyReleased(const KeyEvent& evt) { }
+            void keyHeld    (const KeyEvent& evt);
+            void processKey (const KeyEvent &e);
+
+            void tickInput(float dt, const HandlerState& state);
+
+            std::string buffer_;
+            std::list<BaseInputBufferListenerTuple*> listeners_;
+            std::string allowedChars_;
+            unsigned int cursor_;
+
+            KeyCode::Enum lastKey_;
+            float timeSinceKeyPressed_;
+            float timeSinceKeyRepeated_;
+            int keysToRepeat_;
+
+            float keyRepeatDeleay_;
+            float keyRepeatTime_;
+    };
+}
+
+#endif /* _InputBuffer_H__ */
Index: /code/trunk/src/core/input/InputCommands.cc
===================================================================
--- /code/trunk/src/core/input/InputCommands.cc	(revision 1535)
+++ /code/trunk/src/core/input/InputCommands.cc	(revision 1535)
@@ -0,0 +1,127 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the different input handlers.
+ */
+
+#include "InputCommands.h"
+#include "core/CommandExecutor.h"
+
+namespace orxonox
+{
+  // ###############################
+  // ###  BufferedParamCommand   ###
+  // ###############################
+
+  /**
+  * Executes a buffered command. This is used for commands with additional
+  * parameters.
+  * @return True if command execution was successful or value was zero.
+  */
+  bool BufferedParamCommand::execute()
+  {
+    if (nValuesAdded_)
+    {
+      BufferedParamCommand& cmd = *this;
+      cmd.evaluation_.setEvaluatedParameter(cmd.paramIndex_, cmd.value_);
+      // reset
+      cmd.nValuesAdded_ = 0;
+      cmd.value_ = 0;
+      return cmd.evaluation_.execute();
+    }
+    else
+      return true;
+  }
+
+  // ###############################
+  // #####    SimpleCommand    #####
+  // ###############################
+
+  /**
+  * Executes a simple command with no additional paramters.
+  * @return True if command execution was successful, false otherwise.
+  */
+  bool SimpleCommand::execute(float abs, float rel)
+  {
+    return evaluation_.execute();
+  }
+
+  // ###############################
+  // #####    ParamCommand     #####
+  // ###############################
+
+  /**
+  * Executes a parameter command. The commmand string is not directly executed,
+  * but instead stored in a buffer list so that values can be combined.
+  * @return Always true.
+  */
+  bool ParamCommand::execute(float abs, float rel)
+  {
+    BufferedParamCommand& cmd = *paramCommand_;
+    // command has an additional parameter
+    if (bRelative_)
+    {
+      if (rel != 0.0f)
+      {
+        // we have to calculate a relative movement.
+        // paramModifier_ says how much one keystroke is
+        cmd.value_ += paramModifier_ * rel;
+      }
+    }
+    else if (abs != 0.0f)
+    {
+      // Usually, joy sticks create 'noise' (they return values if they're in 0 position)
+      // and normally this is caught in tickInput(), but that threshold cannot be to high
+      // in order to preserve accuracy. Instead, we have to catch the problem here. An example:
+      // Someone only uses buttons with an active joystick. The joy stick value could then
+      // be 0.05 for instance and the the key value 1. Without handling the problem, the final
+      // value would be computed to (1+0.05)/2=0.5025 which is not what the user expects.
+      float absQ = abs * abs;
+      float valueQ = cmd.value_ * cmd.value_;
+      if (absQ > 50.0f * valueQ) // ease up comparison by using quadratics
+      {
+        cmd.value_ = abs * paramModifier_;
+        cmd.nValuesAdded_ = 1;
+      }
+      else if (absQ * 50.0f < valueQ)
+      {
+        // abs is too small, we just don't do anything
+      }
+      else
+      {
+        // we have to calculate the absolute position of the axis.
+        // Since there might be another axis that is affected, we have to wait and
+        // store the result in a temporary place
+        cmd.value_ = (cmd.value_ * cmd.nValuesAdded_ + paramModifier_ * abs) / ++cmd.nValuesAdded_;
+      }
+    }
+    return true;
+  }
+}
Index: /code/trunk/src/core/input/InputCommands.h
===================================================================
--- /code/trunk/src/core/input/InputCommands.h	(revision 1535)
+++ /code/trunk/src/core/input/InputCommands.h	(revision 1535)
@@ -0,0 +1,81 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Different definitions of input processing.
+ */
+
+#ifndef _InputCommands_H__
+#define _InputCommands_H__
+
+#include "core/CorePrereqs.h"
+#include "core/CommandEvaluation.h"
+
+namespace orxonox
+{
+  class _CoreExport BufferedParamCommand
+  {
+  public:
+    BufferedParamCommand() : value_(0.0f), nValuesAdded_(0), paramIndex_(-1) { }
+    bool execute();
+
+    float value_;
+    unsigned int nValuesAdded_;
+    int paramIndex_;
+    CommandEvaluation evaluation_;
+  };
+
+  class _CoreExport BaseCommand
+  {
+  public:
+    virtual ~BaseCommand() { }
+    virtual bool execute(float abs = 1.0f, float rel = 1.0f) = 0;
+  };
+
+  class _CoreExport SimpleCommand : public BaseCommand
+  {
+  public:
+    bool execute(float abs = 1.0f, float rel = 1.0f);
+
+    CommandEvaluation evaluation_;
+  };
+
+  class _CoreExport ParamCommand : public BaseCommand
+  {
+  public:
+    ParamCommand() : bRelative_(false), paramModifier_(1.0f), paramCommand_(0) { }
+    bool execute(float abs = 1.0f, float rel = 1.0f);
+
+    bool bRelative_;
+    float paramModifier_;
+    BufferedParamCommand* paramCommand_;
+  };
+}
+
+#endif /* _InputCommands_H__ */
Index: /code/trunk/src/core/input/InputInterfaces.h
===================================================================
--- /code/trunk/src/core/input/InputInterfaces.h	(revision 1535)
+++ /code/trunk/src/core/input/InputInterfaces.h	(revision 1535)
@@ -0,0 +1,322 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Declarations of various interface classes for the input management.
+*/
+
+#ifndef _InputInterfaces_H__
+#define _InputInterfaces_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ois/OIS.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+  namespace KeyCode
+  {
+    // note: KeyCode comments were directly taken from OISKeyboard.h
+    enum Enum
+    {
+      Unassigned    = OIS::KC_UNASSIGNED,  
+      Escape        = OIS::KC_ESCAPE,      
+      NumRow1       = OIS::KC_1,           
+      NumRow2       = OIS::KC_2,           
+      NumRow3       = OIS::KC_3,           
+      NumRow4       = OIS::KC_4,           
+      NumRow5       = OIS::KC_5,           
+      NumRow6       = OIS::KC_6,           
+      NumRow7       = OIS::KC_7,           
+      NumRow8       = OIS::KC_8,           
+      NumRow9       = OIS::KC_9,           
+      NumRow0       = OIS::KC_0,           
+      Minus         = OIS::KC_MINUS,           // - on main keyboard
+      Equals        = OIS::KC_EQUALS,      
+      Back          = OIS::KC_BACK,            // backspace
+      Tab           = OIS::KC_TAB,         
+      Q             = OIS::KC_Q,           
+      W             = OIS::KC_W,           
+      E             = OIS::KC_E,           
+      R             = OIS::KC_R,           
+      T             = OIS::KC_T,           
+      Y             = OIS::KC_Y,           
+      U             = OIS::KC_U,           
+      I             = OIS::KC_I,           
+      O             = OIS::KC_O,           
+      P             = OIS::KC_P,           
+      LeftBracket   = OIS::KC_LBRACKET,    
+      RightBracket  = OIS::KC_RBRACKET,    
+      Return        = OIS::KC_RETURN,          // Enter on main keyboard
+      LeftControl   = OIS::KC_LCONTROL,    
+      A             = OIS::KC_A,           
+      S             = OIS::KC_S,           
+      D             = OIS::KC_D,           
+      F             = OIS::KC_F,           
+      G             = OIS::KC_G,           
+      H             = OIS::KC_H,           
+      J             = OIS::KC_J,           
+      K             = OIS::KC_K,           
+      L             = OIS::KC_L,           
+      Semicolon     = OIS::KC_SEMICOLON,   
+      Apostrophe    = OIS::KC_APOSTROPHE,  
+      Grave         = OIS::KC_GRAVE,           // accent
+      LeftShift     = OIS::KC_LSHIFT,      
+      Backslash     = OIS::KC_BACKSLASH,   
+      Z             = OIS::KC_Z,           
+      X             = OIS::KC_X,           
+      C             = OIS::KC_C,           
+      V             = OIS::KC_V,           
+      B             = OIS::KC_B,           
+      N             = OIS::KC_N,           
+      M             = OIS::KC_M,           
+      Comma         = OIS::KC_COMMA,       
+      Period        = OIS::KC_PERIOD,          // . on main keyboard
+      Slash         = OIS::KC_SLASH,           // / on main keyboard
+      RightShift    = OIS::KC_RSHIFT,      
+      Multiply      = OIS::KC_MULTIPLY,        // * on numeric keypad
+      LeftAlt       = OIS::KC_LMENU,           // left Alt
+      Space         = OIS::KC_SPACE,       
+      CapsLock      = OIS::KC_CAPITAL,     
+      F1            = OIS::KC_F1,          
+      F2            = OIS::KC_F2,          
+      F3            = OIS::KC_F3,          
+      F4            = OIS::KC_F4,          
+      F5            = OIS::KC_F5,          
+      F6            = OIS::KC_F6,          
+      F7            = OIS::KC_F7,          
+      F8            = OIS::KC_F8,          
+      F9            = OIS::KC_F9,          
+      F10           = OIS::KC_F10,         
+      Numlock       = OIS::KC_NUMLOCK,     
+      Scrolllock    = OIS::KC_SCROLL,          // Scroll Lock
+      Numpad7       = OIS::KC_NUMPAD7,     
+      Numpad8       = OIS::KC_NUMPAD8,     
+      Numpad9       = OIS::KC_NUMPAD9,     
+      NumpadSubtract= OIS::KC_SUBTRACT,        // - on numeric keypad
+      Numpad4       = OIS::KC_NUMPAD4,     
+      Numpad5       = OIS::KC_NUMPAD5,     
+      Numpad6       = OIS::KC_NUMPAD6,     
+      NumpadAdd     = OIS::KC_ADD,             // + on numeric keypad
+      Numpad1       = OIS::KC_NUMPAD1,     
+      Numpad2       = OIS::KC_NUMPAD2,     
+      Numpad3       = OIS::KC_NUMPAD3,     
+      Numpad0       = OIS::KC_NUMPAD0,     
+      NumpadPeriod  = OIS::KC_DECIMAL,         // . on numeric keypad
+      LessThan      = OIS::KC_OEM_102,         // < > | on UK/Germany keyboards
+      F11           = OIS::KC_F11,         
+      F12           = OIS::KC_F12,         
+      F13           = OIS::KC_F13,             //                     (NEC PC98)
+      F14           = OIS::KC_F14,             //                     (NEC PC98)
+      F15           = OIS::KC_F15,             //                     (NEC PC98)
+      Kana          = OIS::KC_KANA,            // (Japanese keyboard)
+      ABNT_C1       = OIS::KC_ABNT_C1,         // / ? on Portugese (Brazilian) keyboards
+      Convert       = OIS::KC_CONVERT,         // (Japanese keyboard)
+      NoConvert     = OIS::KC_NOCONVERT,       // (Japanese keyboard)
+      Yen           = OIS::KC_YEN,             // (Japanese keyboard)
+      ABNT_C2       = OIS::KC_ABNT_C2,         // Numpad . on Portugese (Brazilian) keyboards
+      NumpadEquals  = OIS::KC_NUMPADEQUALS,    // = on numeric keypad (NEC PC98)
+      PreviousTrack = OIS::KC_PREVTRACK,       // Previous Track (KC_CIRCUMFLEX on Japanese keyboard)
+      AT            = OIS::KC_AT,              //                     (NEC PC98)
+      Colon         = OIS::KC_COLON,           //                     (NEC PC98)
+      Underline     = OIS::KC_UNDERLINE,       //                     (NEC PC98)
+      Kanji         = OIS::KC_KANJI,           // (Japanese keyboard)
+      Stop          = OIS::KC_STOP,            //                     (NEC PC98)
+      AX            = OIS::KC_AX,              //                     (Japan AX)
+      Unlabeled     = OIS::KC_UNLABELED,       //                        (J3100)
+      NextTrack     = OIS::KC_NEXTTRACK,       // Next Track
+      NumpadEnter   = OIS::KC_NUMPADENTER,     // Enter on numeric keypad
+      RightControl  = OIS::KC_RCONTROL,    
+      Mute          = OIS::KC_MUTE,            // Mute
+      Calculator    = OIS::KC_CALCULATOR,      // Calculator
+      PlayPause     = OIS::KC_PLAYPAUSE,       // Play / Pause
+      MediaStop     = OIS::KC_MEDIASTOP,       // Media Stop
+      VolumeDown    = OIS::KC_VOLUMEDOWN,      // Volume -
+      VolumeUp      = OIS::KC_VOLUMEUP,        // Volume +
+      WebHome       = OIS::KC_WEBHOME,         // Web home
+      NumpadComma   = OIS::KC_NUMPADCOMMA,     // , on numeric keypad (NEC PC98)
+      Divide        = OIS::KC_DIVIDE,          // / on numeric keypad
+      SYSRQ         = OIS::KC_SYSRQ,       
+      RightAlt      = OIS::KC_RMENU,           // right Alt
+      Pause         = OIS::KC_PAUSE,           // Pause
+      Home          = OIS::KC_HOME,            // Home on arrow keypad
+      Up            = OIS::KC_UP,              // UpArrow on arrow keypad
+      PageUp        = OIS::KC_PGUP,            // PgUp on arrow keypad
+      Left          = OIS::KC_LEFT,            // LeftArrow on arrow keypad
+      Right         = OIS::KC_RIGHT,           // RightArrow on arrow keypad
+      End           = OIS::KC_END,             // End on arrow keypad
+      Down          = OIS::KC_DOWN,            // DownArrow on arrow keypad
+      PageDown      = OIS::KC_PGDOWN,          // PgDn on arrow keypad
+      Insert        = OIS::KC_INSERT,          // Insert on arrow keypad
+      Delete        = OIS::KC_DELETE,          // Delete on arrow keypad
+      LeftWindows   = OIS::KC_LWIN,            // Left Windows key
+      RightWindows  = OIS::KC_RWIN,            // Right Windows key
+      Apps          = OIS::KC_APPS,            // AppMenu key
+      Power         = OIS::KC_POWER,           // System Power
+      Sleep         = OIS::KC_SLEEP,           // System Sleep
+      Wake          = OIS::KC_WAKE,            // System Wake
+      WebSearch     = OIS::KC_WEBSEARCH,       // Web Search
+      WebFavorites  = OIS::KC_WEBFAVORITES,    // Web Favorites
+      WebRefresh    = OIS::KC_WEBREFRESH,      // Web Refresh
+      WebStop       = OIS::KC_WEBSTOP,         // Web Stop
+      WebForward    = OIS::KC_WEBFORWARD,      // Web Forward
+      WebBack       = OIS::KC_WEBBACK,         // Web Back
+      MyComputer    = OIS::KC_MYCOMPUTER,      // My Computer
+      Mail          = OIS::KC_MAIL,            // Mail
+      MediaSelect   = OIS::KC_MEDIASELECT      // Media Select
+    };
+  }
+
+  namespace MouseButton
+  {
+    enum Enum
+    {
+      Left    = OIS::MB_Left,
+      Right   = OIS::MB_Right,
+      Middle  = OIS::MB_Middle,
+      Button3 = OIS::MB_Button3,
+      Button4 = OIS::MB_Button4,
+      Button5 = OIS::MB_Button5,
+      Button6 = OIS::MB_Button6,
+      Button7 = OIS::MB_Button7
+    };
+  }
+
+  namespace KeyboardModifier
+  {
+    enum Enum
+    {
+      Shift = 0x0000001,
+      Ctrl  = 0x0000010,
+      Alt   = 0x0000100
+    };
+  }
+
+  struct _CoreExport Key
+  {
+    Key(const OIS::KeyEvent& evt) : key((KeyCode::Enum)evt.key), text(evt.text) { }
+    KeyCode::Enum key;
+    unsigned int text;
+  };
+
+  class _CoreExport KeyEvent
+  {
+  public:
+    KeyEvent(KeyCode::Enum key, unsigned int text) : key(key), text(text) { }
+    KeyEvent(const OIS::KeyEvent& evt, unsigned int mod) : key((KeyCode::Enum)evt.key), text(evt.text), modifiers(mod) { }
+    KeyEvent(const Key& key, unsigned int mod) : key(key.key), text(key.text), modifiers(mod) { }
+    bool isModifierDown(KeyboardModifier::Enum modifier) const { return (KeyboardModifier::Enum)modifier&modifiers; }
+
+    const KeyCode::Enum key;
+    unsigned int text;
+    unsigned int modifiers;
+  };
+
+  //typedef OIS::MouseState MouseState;
+
+  /*class _CoreExport JoyStickState
+  {
+  public:
+    JoyStickState(const OIS::JoyStickState& state, int ID) : OIS::JoyStickState(state), mJoyStickID(ID) { }
+    JoyStickState() { clear(); }
+    int mJoyStickID;
+		JoyStickState() { clear(); }
+
+		std::vector<bool> mButtons;
+		int axes[16];
+		std::vector<Vector3> mVectors;
+  };*/
+  
+  /**
+  * Helper struct to determine which handlers of an object (can implement
+  * multiple handlers) are active.
+  */
+  struct HandlerState
+  {
+    HandlerState() : key(false), mouse(false), joyStick(false) { }
+    bool key;
+    bool mouse;
+    bool joyStick;
+  };
+
+  class _CoreExport InputTickable
+  {
+  public:
+    virtual ~InputTickable() { }
+    virtual void tickInput(float dt, const HandlerState& state) = 0;
+  };
+
+  /**
+    @brief Interface class used for key input listeners.
+  */
+  class _CoreExport KeyHandler : virtual public InputTickable
+  {
+  public:
+    virtual ~KeyHandler() { }
+    virtual void keyPressed (const KeyEvent& evt) = 0;
+    virtual void keyReleased(const KeyEvent& evt) = 0;
+    virtual void keyHeld    (const KeyEvent& evt) = 0;
+    //virtual void tickKey    (float dt) { }
+  };
+
+  /**
+    @brief Interface class used for mouse input listeners.
+  */
+  class _CoreExport MouseHandler : virtual public InputTickable
+  {
+  public:
+    virtual ~MouseHandler() { }
+    virtual void mouseButtonPressed (MouseButton::Enum id) = 0;
+    virtual void mouseButtonReleased(MouseButton::Enum id) = 0;
+    virtual void mouseButtonHeld    (MouseButton::Enum id) = 0;
+    virtual void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) = 0;
+    virtual void mouseScrolled      (int abs, int rel)     = 0;
+    //virtual void tickMouse          (float dt) { }
+  };
+
+
+  /**
+    @brief Interface class used for joy stick input listeners.
+  */
+  class _CoreExport JoyStickHandler : virtual public InputTickable
+  {
+  public:
+    virtual ~JoyStickHandler() { }
+    virtual void joyStickButtonPressed (int joyStickID, int button) = 0;
+    virtual void joyStickButtonReleased(int joyStickID, int button) = 0;
+    virtual void joyStickButtonHeld    (int joyStickID, int button) = 0;
+    virtual void joyStickAxisMoved     (int joyStickID, int axis, float value) = 0;
+    //virtual bool joyStickVector3Moved  (int joyStickID, int index /*, fill list*/) {return true;}
+    //virtual void tickJoyStick          (float dt) { }
+  };
+
+}
+
+#endif /* _InputInterfaces_H__ */
Index: /code/trunk/src/core/input/InputManager.cc
===================================================================
--- /code/trunk/src/core/input/InputManager.cc	(revision 1535)
+++ /code/trunk/src/core/input/InputManager.cc	(revision 1535)
@@ -0,0 +1,1551 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the InputManager that captures all the input from OIS
+         and redirects it to handlers.
+ */
+
+#include "InputManager.h"
+
+#include <limits.h>
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/Debug.h"
+#include "core/CommandExecutor.h"
+#include "core/ConsoleCommand.h"
+#include "core/Shell.h"               // hack!
+#include "InputBuffer.h"
+#include "KeyBinder.h"
+#include "KeyDetector.h"
+#include "CalibratorCallback.h"
+
+namespace orxonox
+{
+  SetConsoleCommandShortcut(InputManager, keyBind);
+  SetConsoleCommandShortcut(InputManager, storeKeyStroke);
+  SetConsoleCommandShortcut(InputManager, calibrate);
+
+  // ###############################
+  // ###    Internal Methods     ###
+  // ###############################
+  // ###############################
+
+  /**
+    @brief Constructor only sets member fields to initial zero values
+           and registers the class in the class hierarchy.
+  */
+  InputManager::InputManager() :
+      inputSystem_(0), keyboard_(0), mouse_(0),
+      joySticksSize_(0),
+      keyBinder_(0), keyDetector_(0), buffer_(0), calibratorCallback_(0),
+      state_(IS_UNINIT), stateRequest_(IS_UNINIT), savedState_(IS_UNINIT),
+      keyboardModifiers_(0)
+  {
+    RegisterRootObject(InputManager);
+  }
+
+  /**
+    @brief The one instance of the InputManager is stored in this function.
+    @return A reference to the only instance of the InputManager
+  */
+  InputManager& InputManager::_getSingleton()
+  {
+    static InputManager theOnlyInstance;
+    return theOnlyInstance;
+  }
+
+  /**
+    @brief Destructor only called at the end of the program, after main.
+  */
+  InputManager::~InputManager()
+  {
+    _destroy();
+  }
+
+  /**
+    @brief Creates the OIS::InputMananger, the keyboard, the mouse and
+           the joysticks and assigns the key bindings.
+    @param windowHnd The window handle of the render window
+    @param windowWidth The width of the render window
+    @param windowHeight The height of the render window
+  */
+  bool InputManager::_initialise(const size_t windowHnd, int windowWidth, int windowHeight,
+        bool createKeyboard, bool createMouse, bool createJoySticks)
+  {
+    if (state_ == IS_UNINIT)
+    {
+      CCOUT(3) << "Initialising Input System..." << std::endl;
+      CCOUT(ORX_DEBUG) << "Initialising OIS components..." << std::endl;
+
+      OIS::ParamList paramList;
+      std::ostringstream windowHndStr;
+
+      // Fill parameter list
+      windowHndStr << (unsigned int)windowHnd;
+      paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+      //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
+      //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
+//#if defined OIS_LINUX_PLATFORM
+//      paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
+//#endif
+
+      try
+      {
+        inputSystem_ = OIS::InputManager::createInputSystem(paramList);
+        CCOUT(ORX_DEBUG) << "Created OIS input system" << std::endl;
+      }
+      catch (OIS::Exception ex)
+      {
+        CCOUT(ORX_ERROR) << "Error: Failed creating an OIS input system."
+            << "OIS message: \"" << ex.eText << "\"" << std::endl;
+        inputSystem_ = 0;
+        return false;
+      }
+
+      if (createKeyboard)
+        _initialiseKeyboard();
+
+      if (createMouse)
+        _initialiseMouse();
+
+      if (createJoySticks)
+        _initialiseJoySticks();
+
+      // Set mouse/joystick region
+      if (mouse_)
+      {
+        setWindowExtents(windowWidth, windowHeight);
+      }
+
+      state_ = IS_NONE;
+      CCOUT(ORX_DEBUG) << "Initialising OIS components done." << std::endl;
+
+      // InputManager holds the input buffer --> create one and add it.
+      buffer_ = new InputBuffer();
+      addKeyHandler(buffer_, "buffer");
+      Shell::getInstance().setInputBuffer(buffer_);
+
+      keyBinder_ = new KeyBinder();
+      keyBinder_->loadBindings();
+      addKeyHandler(keyBinder_, "keybinder");
+      addMouseHandler(keyBinder_, "keybinder");
+      addJoyStickHandler(keyBinder_, "keybinder");
+
+      keyDetector_ = new KeyDetector();
+      keyDetector_->loadBindings();
+      addKeyHandler(keyDetector_, "keydetector");
+      addMouseHandler(keyDetector_, "keydetector");
+      addJoyStickHandler(keyDetector_, "keydetector");
+
+      calibratorCallback_ = new CalibratorCallback();
+      addKeyHandler(calibratorCallback_, "calibratorcallback");
+
+      setConfigValues();
+
+      CCOUT(ORX_DEBUG) << "Initialising complete." << std::endl;
+    }
+    else
+    {
+      CCOUT(ORX_WARNING) << "Warning: OIS compoments already initialised, skipping" << std::endl;
+    }
+    return true;
+  }
+
+  /**
+    @brief Creates a keyboard and sets the event handler.
+    @return False if keyboard stays uninitialised, true otherwise.
+  */
+  bool InputManager::_initialiseKeyboard()
+  {
+    if (keyboard_ != 0)
+    {
+      CCOUT(2) << "Warning: Keyboard already initialised, skipping." << std::endl;
+      return true;
+    }
+    try
+    {
+      if (inputSystem_->getNumberOfDevices(OIS::OISKeyboard) > 0)
+      {
+        keyboard_ = (OIS::Keyboard*)inputSystem_->createInputObject(OIS::OISKeyboard, true);
+        // register our listener in OIS.
+        keyboard_->setEventCallback(this);
+        // note: OIS will not detect keys that have already been down when the keyboard was created.
+        CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
+        return true;
+      }
+      else
+      {
+        CCOUT(ORX_WARNING) << "Warning: No keyboard found!" << std::endl;
+        return false;
+      }
+    }
+    catch (OIS::Exception ex)
+    {
+      // TODO: Test this output regarding formatting
+      CCOUT(ORX_WARNING) << "Warning: Failed to create an OIS keyboard\n"
+          << "OIS error message: \"" << ex.eText << "\"" << std::endl;
+      keyboard_ = 0;
+      return false;
+    }
+  }
+
+  /**
+    @brief Creates a mouse and sets the event handler.
+    @return False if mouse stays uninitialised, true otherwise.
+  */
+  bool InputManager::_initialiseMouse()
+  {
+    if (mouse_ != 0)
+    {
+      CCOUT(2) << "Warning: Mouse already initialised, skipping." << std::endl;
+      return true;
+    }
+    try
+    {
+      if (inputSystem_->getNumberOfDevices(OIS::OISMouse) > 0)
+      {
+        mouse_ = static_cast<OIS::Mouse*>(inputSystem_->createInputObject(OIS::OISMouse, true));
+        // register our listener in OIS.
+        mouse_->setEventCallback(this);
+        CCOUT(ORX_DEBUG) << "Created OIS mouse" << std::endl;
+        return true;
+      }
+      else
+      {
+        CCOUT(ORX_WARNING) << "Warning: No mouse found!" << std::endl;
+        return false;
+      }
+    }
+    catch (OIS::Exception ex)
+    {
+      CCOUT(ORX_WARNING) << "Warning: Failed to create an OIS mouse\n"
+          << "OIS error message: \"" << ex.eText << "\"" << std::endl;
+      mouse_ = 0;
+      return false;
+    }
+  }
+
+  /**
+    @brief Creates all joy sticks and sets the event handler.
+    @return False joy stick stay uninitialised, true otherwise.
+  */
+  bool InputManager::_initialiseJoySticks()
+  {
+    if (joySticksSize_ > 0)
+    {
+      CCOUT(2) << "Warning: Joy sticks already initialised, skipping." << std::endl;
+      return true;
+    }
+    bool success = false;
+    if (inputSystem_->getNumberOfDevices(OIS::OISJoyStick) > 0)
+    {
+      for (int i = 0; i < inputSystem_->getNumberOfDevices(OIS::OISJoyStick); i++)
+      {
+        try
+        {
+          OIS::JoyStick* stig = static_cast<OIS::JoyStick*>(inputSystem_->createInputObject(OIS::OISJoyStick, true));
+          joySticks_.push_back(stig);
+          // register our listener in OIS.
+          stig->setEventCallback(this);
+          CCOUT(ORX_DEBUG) << "Created OIS joy stick with ID " << stig->getID() << std::endl;
+          success = true;
+        }
+        catch (OIS::Exception ex)
+        {
+          CCOUT(ORX_WARNING) << "Warning: Failed to create OIS joy number" << i << "\n"
+              << "OIS error message: \"" << ex.eText << "\"" << std::endl;
+        }
+      }
+    }
+    else
+    {
+      CCOUT(ORX_WARNING) << "Warning: Joy stick support requested, but no joy stick was found" << std::endl;
+      return false;
+    }
+    joySticksSize_ = joySticks_.size();
+    activeJoyStickHandlers_.resize(joySticksSize_);
+    joyStickButtonsDown_.resize(joySticksSize_);
+    povStates_.resize(joySticksSize_);
+    sliderStates_.resize(joySticksSize_);
+    joySticksCalibration_.resize(joySticksSize_);
+    for (unsigned int iJoyStick = 0; iJoyStick < joySticksSize_; iJoyStick++)
+    {
+      // reset the calibration with default values
+      for (unsigned int i = 0; i < 24; i++)
+      {
+        joySticksCalibration_[iJoyStick].negativeCoeff[i] = 1.0f/32767.0f;
+        joySticksCalibration_[iJoyStick].positiveCoeff[i] = 1.0f/32768.0f;
+        joySticksCalibration_[iJoyStick].zeroStates[i] = 0;
+      }
+    }
+    return success;
+  }
+
+  /**
+    @brief Sets the configurable values. Use keybindings.ini as file..
+  */
+  void InputManager::setConfigValues()
+  {
+    if (joySticksSize_)
+    {
+      std::vector<MultiTypeMath> coeffPos;
+      std::vector<MultiTypeMath> coeffNeg;
+      std::vector<MultiTypeMath> zero;
+      coeffPos.resize(24);
+      coeffNeg.resize(24);
+      zero.resize(24);
+      for (unsigned int i = 0; i < 24; i++)
+      {
+        coeffPos[i] =  1.0f/32767.0f;
+        coeffNeg[i] =  1.0f/32768.0f;
+        zero[i]     =  0;
+      }
+
+      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
+      if (!cont)
+      {
+          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffPos", coeffPos);
+          getIdentifier()->addConfigValueContainer("CoeffPos", cont);
+      }
+      cont->getValue(&coeffPos);
+
+      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
+      if (!cont)
+      {
+          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "CoeffNeg", coeffNeg);
+          getIdentifier()->addConfigValueContainer("CoeffNeg", cont);
+      }
+      cont->getValue(&coeffNeg);
+
+      cont = getIdentifier()->getConfigValueContainer("Zero");
+      if (!cont)
+      {
+          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), "Zero", zero);
+          getIdentifier()->addConfigValueContainer("Zero", cont);
+      }
+      cont->getValue(&zero);
+
+      // copy values to our own variables
+      for (unsigned int i = 0; i < 24; i++)
+      {
+        joySticksCalibration_[0].positiveCoeff[i] = coeffPos[i];
+        joySticksCalibration_[0].negativeCoeff[i] = coeffNeg[i];
+        joySticksCalibration_[0].zeroStates[i]    = zero[i];
+      }
+    }
+  }
+
+  /**
+    @brief Destroys all the created input devices and sets the InputManager to construction state.
+  */
+  void InputManager::_destroy()
+  {
+    if (state_ != IS_UNINIT)
+    {
+      CCOUT(ORX_DEBUG) << "Destroying ..." << std::endl;
+
+      if (buffer_)
+        delete buffer_;
+
+      if (keyBinder_)
+        delete keyBinder_;
+
+      if (keyDetector_)
+        delete keyDetector_;
+
+      if (calibratorCallback_)
+        delete calibratorCallback_;
+
+      keyHandlers_.clear();
+      mouseHandlers_.clear();
+      joyStickHandlers_.clear();
+
+      _destroyKeyboard();
+      _destroyMouse();
+      _destroyJoySticks();
+
+      activeHandlers_.clear();
+
+      // inputSystem_ can never be 0, or else the code is mistaken
+      OIS::InputManager::destroyInputSystem(inputSystem_);
+      inputSystem_ = 0;
+
+      state_ = IS_UNINIT;
+      CCOUT(ORX_DEBUG) << "Destroying done." << std::endl;
+    }
+  }
+
+  /**
+    @brief Destroys the keyboard and sets it to 0.
+  */
+  void InputManager::_destroyKeyboard()
+  {
+    if (keyboard_)
+      // inputSystem_ can never be 0, or else the code is mistaken
+      inputSystem_->destroyInputObject(keyboard_);
+    keyboard_ = 0;
+    activeKeyHandlers_.clear();
+    keysDown_.clear();
+    CCOUT(ORX_DEBUG) << "Keyboard destroyed." << std::endl;
+  }
+
+  /**
+    @brief Destroys the mouse and sets it to 0.
+  */
+  void InputManager::_destroyMouse()
+  {
+    if (mouse_)
+      // inputSystem_ can never be 0, or else the code is mistaken
+      inputSystem_->destroyInputObject(mouse_);
+    mouse_ = 0;
+    activeMouseHandlers_.clear();
+    mouseButtonsDown_.clear();
+    CCOUT(ORX_DEBUG) << "Mouse destroyed." << std::endl;
+  }
+
+  /**
+    @brief Destroys all the joy sticks and resizes the lists to 0.
+  */
+  void InputManager::_destroyJoySticks()
+  {
+    if (joySticksSize_ > 0)
+    {
+      // note: inputSystem_ can never be 0, or else the code is mistaken
+      for (unsigned int i = 0; i < joySticksSize_; i++)
+        if (joySticks_[i] != 0)
+          inputSystem_->destroyInputObject(joySticks_[i]);
+
+      joySticks_.clear();
+      joySticksSize_ = 0;
+      activeJoyStickHandlers_.clear();
+      joyStickButtonsDown_.clear();
+      povStates_.clear();
+      sliderStates_.clear();
+      joySticksCalibration_.clear();
+    }
+    CCOUT(ORX_DEBUG) << "Joy sticks destroyed." << std::endl;
+  }
+
+  void InputManager::_saveState()
+  {
+    savedHandlers_.activeHandlers_ = activeHandlers_;
+    savedHandlers_.activeJoyStickHandlers_ = activeJoyStickHandlers_;
+    savedHandlers_.activeKeyHandlers_ = activeKeyHandlers_;
+    savedHandlers_.activeMouseHandlers_ = activeMouseHandlers_;
+  }
+
+  void InputManager::_restoreState()
+  {
+    activeHandlers_ = savedHandlers_.activeHandlers_;
+    activeJoyStickHandlers_ = savedHandlers_.activeJoyStickHandlers_;
+    activeKeyHandlers_ = savedHandlers_.activeKeyHandlers_;
+    activeMouseHandlers_ = savedHandlers_.activeMouseHandlers_;
+  }
+
+  void InputManager::_updateTickables()
+  {
+    // we can use a map to have a list of unique pointers (an object can implement all 3 handlers)
+    std::map<InputTickable*, HandlerState> tempSet;
+    for (unsigned int iHandler = 0; iHandler < activeKeyHandlers_.size(); iHandler++)
+      tempSet[activeKeyHandlers_[iHandler]].joyStick = true;
+    for (unsigned int iHandler = 0; iHandler < activeMouseHandlers_.size(); iHandler++)
+      tempSet[activeMouseHandlers_[iHandler]].mouse = true;
+    for (unsigned int iJoyStick  = 0; iJoyStick < joySticksSize_; iJoyStick++)
+      for (unsigned int iHandler = 0; iHandler  < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+        tempSet[activeJoyStickHandlers_[iJoyStick][iHandler]].joyStick = true;
+
+    // copy the content of the map back to the actual vector
+    activeHandlers_.clear();
+    for (std::map<InputTickable*, HandlerState>::const_iterator itHandler = tempSet.begin();
+        itHandler != tempSet.end(); itHandler++)
+      activeHandlers_.push_back(std::pair<InputTickable*, HandlerState>((*itHandler).first, (*itHandler).second));
+  }
+
+
+  // #################################
+  // ### Private Interface Methods ###
+  // #################################
+  // #################################
+
+  /**
+    @brief Updates the InputManager. Tick is called by Orxonox.
+    @param dt Delta time
+  */
+  void InputManager::_tick(float dt)
+  {
+    if (state_ == IS_UNINIT)
+      return;
+
+    if (state_ != stateRequest_)
+    {
+      InputState sr = stateRequest_;
+      switch (sr)
+      {
+      case IS_NORMAL:
+        activeKeyHandlers_.clear();
+        activeMouseHandlers_.clear();
+        for (unsigned int i = 0; i < joySticksSize_; i++)
+          activeJoyStickHandlers_[i].clear();
+
+        // normal play mode
+        // note: we assume that the handlers exist since otherwise, something's wrong anyway.
+        enableKeyHandler("keybinder");
+        enableMouseHandler("keybinder");
+        enableJoyStickHandler("keybinder", 0);
+        stateRequest_ = IS_NORMAL;
+        state_ = IS_NORMAL;
+        break;
+
+      case IS_GUI:
+        state_ = IS_GUI;
+        break;
+
+      case IS_CONSOLE:
+        activeKeyHandlers_.clear();
+        activeMouseHandlers_.clear();
+        for (unsigned int i = 0; i < joySticksSize_; i++)
+          activeJoyStickHandlers_[i].clear();
+
+        enableMouseHandler("keybinder");
+        enableJoyStickHandler("keybinder", 0);
+        enableKeyHandler("buffer");
+        stateRequest_ = IS_CONSOLE;
+        state_ = IS_CONSOLE;
+        break;
+
+      case IS_DETECT:
+        savedState_ = state_;
+        _saveState();
+
+        activeKeyHandlers_.clear();
+        activeMouseHandlers_.clear();
+        for (unsigned int i = 0; i < joySticksSize_; i++)
+          activeJoyStickHandlers_[i].clear();
+
+        enableKeyHandler("keydetector");
+        enableMouseHandler("keydetector");
+        enableJoyStickHandler("keydetector", 0);
+
+        stateRequest_ = IS_DETECT;
+        state_ = IS_DETECT;
+        break;
+
+      case IS_NODETECT:
+        _restoreState();
+        keysDown_.clear();
+        mouseButtonsDown_.clear();
+        joyStickButtonsDown_[0].clear();
+        state_ = IS_NODETECT;
+        stateRequest_ = savedState_;
+        break;
+
+      case IS_CALIBRATE:
+        if (joySticksSize_)
+        {
+          savedState_ = _getSingleton().state_;
+          for (unsigned int i = 0; i < 24; i++)
+          {
+            marginalsMax_[i] = INT_MIN;
+            marginalsMin_[i] = INT_MAX;
+          }
+          COUT(0) << "Move all joy stick axes in all directions a few times. "
+            << "Then put all axes in zero state and hit enter." << std::endl;
+
+          savedState_ = state_;
+          _saveState();
+
+          activeKeyHandlers_.clear();
+          activeMouseHandlers_.clear();
+          for (unsigned int i = 0; i < joySticksSize_; i++)
+            activeJoyStickHandlers_[i].clear();
+
+          enableKeyHandler("calibratorcallback");
+          stateRequest_ = IS_CALIBRATE;
+          state_ = IS_CALIBRATE;
+        }
+        else
+        {
+          COUT(3) << "Connot calibrate, no joy stick found!" << std::endl;
+          stateRequest_ = state_;
+        }
+        break;
+
+      case IS_NOCALIBRATE:
+        _completeCalibration();
+        _restoreState();
+        keyBinder_->resetJoyStickAxes();
+        state_ = IS_NOCALIBRATE;
+        stateRequest_ = savedState_;
+        break;
+
+      case IS_NONE:
+        activeKeyHandlers_.clear();
+        activeMouseHandlers_.clear();
+        for (unsigned int i = 0; i < joySticksSize_; i++)
+          activeJoyStickHandlers_[i].clear();
+        state_ = IS_NONE;
+
+      default:
+        break;
+      }
+    }
+
+    // Capture all the input. This calls the event handlers in InputManager.
+    if (mouse_)
+      mouse_->capture();
+    if (keyboard_)
+      keyboard_->capture();
+    for (unsigned  int i = 0; i < joySticksSize_; i++)
+      joySticks_[i]->capture();
+
+    if (state_ != IS_CALIBRATE)
+    {
+      // call all the handlers for the held key events
+      for (unsigned int iKey = 0; iKey < keysDown_.size(); iKey++)
+        for (unsigned int iHandler = 0; iHandler < activeKeyHandlers_.size(); iHandler++)
+          activeKeyHandlers_[iHandler]->keyHeld(KeyEvent(keysDown_[iKey], keyboardModifiers_));
+
+      // call all the handlers for the held mouse button events
+      for (unsigned int iButton = 0; iButton < mouseButtonsDown_.size(); iButton++)
+        for (unsigned int iHandler = 0; iHandler < activeMouseHandlers_.size(); iHandler++)
+          activeMouseHandlers_[iHandler]->mouseButtonHeld(mouseButtonsDown_[iButton]);
+
+      // call all the handlers for the held joy stick button events
+      for (unsigned int iJoyStick  = 0; iJoyStick < joySticksSize_; iJoyStick++)
+        for (unsigned int iButton   = 0; iButton   < joyStickButtonsDown_[iJoyStick].size(); iButton++)
+          for (unsigned int iHandler = 0; iHandler  < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+            activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonHeld(iJoyStick, joyStickButtonsDown_[iJoyStick][iButton]);
+    }
+
+    // call the ticks for the handlers (need to be treated specially)
+    for (unsigned int iHandler = 0; iHandler < activeHandlers_.size(); iHandler++)
+      activeHandlers_[iHandler].first->tickInput(dt, activeHandlers_[iHandler].second);
+  }
+    
+  void InputManager::_completeCalibration()
+  {
+    for (unsigned int i = 0; i < 24; i++)
+    {
+      // positive coefficient
+      if (marginalsMax_[i] == INT_MIN)
+        marginalsMax_[i] =  32767;
+      // coefficients
+      if (marginalsMax_[i] - joySticksCalibration_[0].zeroStates[i])
+        joySticksCalibration_[0].positiveCoeff[i] =  1.0f/(marginalsMax_[i] - joySticksCalibration_[0].zeroStates[i]);
+      else
+        joySticksCalibration_[0].positiveCoeff[i] =  1.0f;
+
+      // config value
+      ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer("CoeffPos");
+      assert(cont);
+      cont->set(i, joySticksCalibration_[0].positiveCoeff[i]);
+
+      // negative coefficient
+      if (marginalsMin_[i] == INT_MAX)
+        marginalsMin_[i] = -32768;
+      // coefficients
+      if (marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i])
+        joySticksCalibration_[0].negativeCoeff[i] = -1.0f/(marginalsMin_[i] - joySticksCalibration_[0].zeroStates[i]);
+      else
+        joySticksCalibration_[0].negativeCoeff[i] =  1.0f;
+      // config value
+      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
+      assert(cont);
+      cont->set(i, joySticksCalibration_[0].negativeCoeff[i]);
+
+      // zero states
+      if (i < 8)
+      {
+        if (!(i & 1))
+          joySticksCalibration_[0].zeroStates[i] = joySticks_[0]->getJoyStickState().mSliders[i/2].abX;
+        else
+          joySticksCalibration_[0].zeroStates[i] = joySticks_[0]->getJoyStickState().mSliders[i/2].abY;
+      }
+      else
+      {
+        if (i - 8 < joySticks_[0]->getJoyStickState().mAxes.size())
+          joySticksCalibration_[0].zeroStates[i] = joySticks_[0]->getJoyStickState().mAxes[i - 8].abs;
+        else
+          joySticksCalibration_[0].zeroStates[i] = 0;
+      }
+      // config value
+      cont = getIdentifier()->getConfigValueContainer("Zero");
+      assert(cont);
+      cont->set(i, joySticksCalibration_[0].zeroStates[i]);
+    }
+  }
+
+  // ###### Key Events ######
+
+  /**
+    @brief Event handler for the keyPressed Event.
+    @param e Event information
+  */
+  bool InputManager::keyPressed(const OIS::KeyEvent &e)
+  {
+    // check whether the key already is in the list (can happen when focus was lost)
+    unsigned int iKey = 0;
+    while (iKey < keysDown_.size() && keysDown_[iKey].key != (KeyCode::Enum)e.key)
+      iKey++;
+    if (iKey == keysDown_.size())
+      keysDown_.push_back(Key(e));
+
+    // update modifiers
+    if(e.key == OIS::KC_RMENU    || e.key == OIS::KC_LMENU)
+      keyboardModifiers_ |= KeyboardModifier::Alt;   // alt key
+    if(e.key == OIS::KC_RCONTROL || e.key == OIS::KC_LCONTROL)
+      keyboardModifiers_ |= KeyboardModifier::Ctrl;  // ctrl key
+    if(e.key == OIS::KC_RSHIFT   || e.key == OIS::KC_LSHIFT)
+      keyboardModifiers_ |= KeyboardModifier::Shift; // shift key
+
+    for (unsigned int i = 0; i < activeKeyHandlers_.size(); i++)
+      activeKeyHandlers_[i]->keyPressed(KeyEvent(e, keyboardModifiers_));
+
+    return true;
+  }
+
+  /**
+    @brief Event handler for the keyReleased Event.
+    @param e Event information
+  */
+  bool InputManager::keyReleased(const OIS::KeyEvent &e)
+  {
+    // remove the key from the keysDown_ list
+    for (unsigned int iKey = 0; iKey < keysDown_.size(); iKey++)
+    {
+      if (keysDown_[iKey].key == (KeyCode::Enum)e.key)
+      {
+        keysDown_.erase(keysDown_.begin() + iKey);
+        break;
+      }
+    }
+
+    // update modifiers
+    if(e.key == OIS::KC_RMENU    || e.key == OIS::KC_LMENU)
+      keyboardModifiers_ &= ~KeyboardModifier::Alt;   // alt key
+    if(e.key == OIS::KC_RCONTROL || e.key == OIS::KC_LCONTROL)
+      keyboardModifiers_ &= ~KeyboardModifier::Ctrl;  // ctrl key
+    if(e.key == OIS::KC_RSHIFT   || e.key == OIS::KC_LSHIFT)
+      keyboardModifiers_ &= ~KeyboardModifier::Shift; // shift key
+
+    for (unsigned int i = 0; i < activeKeyHandlers_.size(); i++)
+      activeKeyHandlers_[i]->keyReleased(KeyEvent(e, keyboardModifiers_));
+
+    return true;
+  }
+
+
+  // ###### Mouse Events ######
+
+  /**
+    @brief Event handler for the mouseMoved Event.
+    @param e Event information
+  */
+  bool InputManager::mouseMoved(const OIS::MouseEvent &e)
+  {
+    // check for actual moved event
+    if (e.state.X.rel != 0 || e.state.Y.rel != 0)
+    {
+      for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
+        activeMouseHandlers_[i]->mouseMoved(IntVector2(e.state.X.abs, e.state.Y.abs),
+            IntVector2(e.state.X.rel, e.state.Y.rel), IntVector2(e.state.width, e.state.height));
+    }
+
+    // check for mouse scrolled event
+    if (e.state.Z.rel != 0)
+    {
+      for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
+        activeMouseHandlers_[i]->mouseScrolled(e.state.Z.abs, e.state.Z.rel);
+    }
+
+    return true;
+  }
+
+  /**
+    @brief Event handler for the mousePressed Event.
+    @param e Event information
+    @param id The ID of the mouse button
+  */
+  bool InputManager::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id)
+  {
+    // check whether the button already is in the list (can happen when focus was lost)
+    unsigned int iButton = 0;
+    while (iButton < mouseButtonsDown_.size() && mouseButtonsDown_[iButton] != (MouseButton::Enum)id)
+      iButton++;
+    if (iButton == mouseButtonsDown_.size())
+      mouseButtonsDown_.push_back((MouseButton::Enum)id);
+
+    for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
+      activeMouseHandlers_[i]->mouseButtonPressed((MouseButton::Enum)id);
+
+    return true;
+  }
+
+  /**
+    @brief Event handler for the mouseReleased Event.
+    @param e Event information
+    @param id The ID of the mouse button
+  */
+  bool InputManager::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id)
+  {
+    // remove the button from the keysDown_ list
+    for (unsigned int iButton = 0; iButton < mouseButtonsDown_.size(); iButton++)
+    {
+      if (mouseButtonsDown_[iButton] == (MouseButton::Enum)id)
+      {
+        mouseButtonsDown_.erase(mouseButtonsDown_.begin() + iButton);
+        break;
+      }
+    }
+
+    for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
+      activeMouseHandlers_[i]->mouseButtonReleased((MouseButton::Enum)id);
+
+    return true;
+  }
+
+
+  // ###### Joy Stick Events ######
+
+  inline unsigned int InputManager::_getJoystick(const OIS::JoyStickEvent& arg)
+  {
+    // use the device to identify which one called the method
+    OIS::JoyStick* joyStick = (OIS::JoyStick*)arg.device;
+    unsigned int iJoyStick = 0;
+    while (joySticks_[iJoyStick] != joyStick)
+    {
+      iJoyStick++;
+      if (iJoyStick == joySticksSize_)
+      {
+        CCOUT(3) << "Unknown joystick fired an event. This means there is a bug somewhere! Aborting." << std::endl;
+        abort();
+      }
+    }
+    return iJoyStick;
+  }
+
+  bool InputManager::buttonPressed(const OIS::JoyStickEvent &arg, int button)
+  {
+    unsigned int iJoyStick = _getJoystick(arg);
+
+    // check whether the button already is in the list (can happen when focus was lost)
+    std::vector<int>& buttonsDown = joyStickButtonsDown_[iJoyStick];
+    unsigned int iButton = 0;
+    while (iButton < buttonsDown.size() && buttonsDown[iButton] != button)
+      iButton++;
+    if (iButton == buttonsDown.size())
+      buttonsDown.push_back(button);
+
+    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonPressed(iJoyStick, button);
+
+    return true;
+  }
+
+  bool InputManager::buttonReleased(const OIS::JoyStickEvent &arg, int button)
+  {
+    unsigned int iJoyStick = _getJoystick(arg);
+
+    // remove the button from the joyStickButtonsDown_ list
+    std::vector<int>& buttonsDown = joyStickButtonsDown_[iJoyStick];
+    for (unsigned int iButton = 0; iButton < buttonsDown.size(); iButton++)
+    {
+      if (buttonsDown[iButton] == button)
+      {
+        buttonsDown.erase(buttonsDown.begin() + iButton);
+        break;
+      }
+    }
+
+    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonReleased(iJoyStick, button);
+
+    return true;
+  }
+
+  void InputManager::_fireAxis(unsigned int iJoyStick, int axis, int value)
+  {
+    if (state_ == IS_CALIBRATE)
+    {
+      if (value > marginalsMax_[axis])
+        marginalsMax_[axis] = value;
+      if (value < marginalsMin_[axis])
+        marginalsMin_[axis] = value;
+    }
+    else
+    {
+      float fValue = value - joySticksCalibration_[iJoyStick].zeroStates[axis];
+      if (fValue > 0.0f)
+        fValue *= joySticksCalibration_[iJoyStick].positiveCoeff[axis];
+      else
+        fValue *= joySticksCalibration_[iJoyStick].negativeCoeff[axis];
+
+      for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+        activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickAxisMoved(iJoyStick, axis, fValue);
+    }
+  }
+
+  bool InputManager::axisMoved(const OIS::JoyStickEvent &arg, int axis)
+  {
+    //if (arg.state.mAxes[axis].abs > 10000 || arg.state.mAxes[axis].abs < -10000)
+    //{ CCOUT(3) << "axis " << axis << " moved" << arg.state.mAxes[axis].abs << std::endl;}
+
+    unsigned int iJoyStick = _getJoystick(arg);
+
+    // keep in mind that the first 8 axes are reserved for the sliders
+    _fireAxis(iJoyStick, axis + 8, arg.state.mAxes[axis].abs);
+
+    return true;
+  }
+
+  bool InputManager::sliderMoved(const OIS::JoyStickEvent &arg, int id)
+  {
+    //if (arg.state.mSliders[id].abX > 10000 || arg.state.mSliders[id].abX < -10000)
+    //{CCOUT(3) << "slider " << id << " moved" << arg.state.mSliders[id].abX << std::endl;}
+    //CCOUT(3) << arg.state.mSliders[id].abX << "\t |" << arg.state.mSliders[id].abY << std::endl;
+
+    unsigned int iJoyStick = _getJoystick(arg);
+
+    if (sliderStates_[iJoyStick].sliderStates[id].x != arg.state.mSliders[id].abX)
+      _fireAxis(iJoyStick, id * 2, arg.state.mSliders[id].abX);
+    else if (sliderStates_[iJoyStick].sliderStates[id].y != arg.state.mSliders[id].abY)
+      _fireAxis(iJoyStick, id * 2 + 1, arg.state.mSliders[id].abY);
+
+    return true;
+  }
+
+  bool InputManager::povMoved(const OIS::JoyStickEvent &arg, int id)
+  {
+    unsigned int iJoyStick = _getJoystick(arg);
+
+    // translate the POV into 8 simple buttons
+    int lastState = povStates_[iJoyStick][id];
+    if (lastState & OIS::Pov::North)
+      buttonReleased(arg, 32 + id * 4 + 0);
+    if (lastState & OIS::Pov::South)
+      buttonReleased(arg, 32 + id * 4 + 1);
+    if (lastState & OIS::Pov::East)
+      buttonReleased(arg, 32 + id * 4 + 2);
+    if (lastState & OIS::Pov::West)
+      buttonReleased(arg, 32 + id * 4 + 3);
+
+    povStates_[iJoyStick].povStates[id] = arg.state.mPOV[id].direction;
+
+    int currentState = povStates_[iJoyStick][id];
+    if (currentState & OIS::Pov::North)
+      buttonPressed(arg, 32 + id * 4 + 0);
+    if (currentState & OIS::Pov::South)
+      buttonPressed(arg, 32 + id * 4 + 1);
+    if (currentState & OIS::Pov::East)
+      buttonPressed(arg, 32 + id * 4 + 2);
+    if (currentState & OIS::Pov::West)
+      buttonPressed(arg, 32 + id * 4 + 3);
+
+    return true;
+  }
+
+  /*bool InputManager::vector3Moved(const OIS::JoyStickEvent &arg, int id)
+  {
+    unsigned int iJoyStick = _getJoystick(arg);
+
+    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickVector3Moved(JoyStickState(arg.state, iJoyStick), id);
+
+    return true;
+  }*/
+
+
+  // ################################
+  // ### Static Interface Methods ###
+  // ################################
+  // ################################
+
+  std::string InputManager::bindingCommmandString_s = "";
+
+  bool InputManager::initialise(const size_t windowHnd, int windowWidth, int windowHeight,
+    bool createKeyboard, bool createMouse, bool createJoySticks)
+  {
+    return _getSingleton()._initialise(windowHnd, windowWidth, windowHeight,
+          createKeyboard, createMouse, createJoySticks);
+  }
+
+  bool InputManager::initialiseKeyboard()
+  {
+    return _getSingleton()._initialiseKeyboard();
+  }
+
+  bool InputManager::initialiseMouse()
+  {
+    return _getSingleton()._initialiseMouse();
+  }
+
+  bool InputManager::initialiseJoySticks()
+  {
+    return _getSingleton()._initialiseJoySticks();
+  }
+
+  int InputManager::numberOfKeyboards()
+  {
+    if (_getSingleton().keyboard_ != 0)
+      return 1;
+    else
+      return 0;
+  }
+
+  int InputManager::numberOfMice()
+  {
+    if (_getSingleton().mouse_ != 0)
+      return 1;
+    else
+      return 0;
+  }
+
+  int InputManager::numberOfJoySticks()
+  {
+    return _getSingleton().joySticksSize_;
+  }
+
+  /*bool InputManager::isKeyDown(KeyCode::Enum key)
+  {
+    if (_getSingleton().keyboard_)
+      return _getSingleton().keyboard_->isKeyDown((OIS::KeyCode)key);
+    else
+      return false;
+  }*/
+
+  /*bool InputManager::isModifierDown(KeyboardModifier::Enum modifier)
+  {
+    if (_getSingleton().keyboard_)
+      return isModifierDown(modifier);
+    else
+      return false;
+  }*/
+
+  /*const MouseState InputManager::getMouseState()
+  {
+    if (_getSingleton().mouse_)
+      return _getSingleton().mouse_->getMouseState();
+    else
+      return MouseState();
+  }*/
+
+  /*const JoyStickState InputManager::getJoyStickState(unsigned int ID)
+  {
+    if (ID < _getSingleton().joySticksSize_)
+      return JoyStickState(_getSingleton().joySticks_[ID]->getJoyStickState(), ID);
+    else
+      return JoyStickState();
+  }*/
+
+  void InputManager::destroy()
+  {
+    _getSingleton()._destroy();
+  }
+
+  void InputManager::destroyKeyboard()
+  {
+    return _getSingleton()._destroyKeyboard();
+  }
+
+  void InputManager::destroyMouse()
+  {
+    return _getSingleton()._destroyMouse();
+  }
+
+  void InputManager::destroyJoySticks()
+  {
+    return _getSingleton()._destroyJoySticks();
+  }
+
+
+  /**
+    @brief Adjusts the mouse window metrics.
+    This method has to be called every time the size of the window changes.
+    @param width The new width of the render window
+    @param height the new height of the render window
+  */
+  void InputManager::setWindowExtents(const int width, const int height)
+  {
+    if (_getSingleton().mouse_)
+    {
+      // Set mouse region (if window resizes, we should alter this to reflect as well)
+      const OIS::MouseState &mouseState = _getSingleton().mouse_->getMouseState();
+      mouseState.width  = width;
+      mouseState.height = height;
+    }
+  }
+
+  /**
+    @brief Sets the input mode to either GUI, inGame or Buffer
+    @param mode The new input mode
+    @remark Only has an affect if the mode actually changes
+  */
+  void InputManager::setInputState(const InputState state)
+  {
+    _getSingleton().stateRequest_ = state;
+  }
+
+  /**
+    @brief Returns the current input handling method
+    @return The current input mode.
+  */
+  InputManager::InputState InputManager::getInputState()
+  {
+    return _getSingleton().state_;
+  }
+
+  void InputManager::storeKeyStroke(const std::string& name)
+  {
+    setInputState(IS_NODETECT);
+    COUT(0) << "Binding string \"" << bindingCommmandString_s << "\" on key '" << name << "'" << std::endl;
+    CommandExecutor::execute("config KeyBinder " + name + " " + bindingCommmandString_s, false);
+  }
+
+  void InputManager::keyBind(const std::string& command)
+  {
+    bindingCommmandString_s = command;
+    setInputState(IS_DETECT);
+    COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
+  }
+
+  void InputManager::calibrate()
+  {
+    _getSingleton().setInputState(IS_CALIBRATE);
+  }
+
+  void InputManager::tick(float dt)
+  {
+    _getSingleton()._tick(dt);
+  }
+
+  // ###### KeyHandler ######
+
+  /**
+    @brief Adds a new key handler.
+    @param handler Pointer to the handler object.
+    @param name Unique name of the handler.
+    @return True if added, false if name already existed.
+  */
+  bool InputManager::addKeyHandler(KeyHandler* handler, const std::string& name)
+  {
+    if (!handler)
+      return false;
+    if (_getSingleton().keyHandlers_.find(name) == _getSingleton().keyHandlers_.end())
+    {
+      _getSingleton().keyHandlers_[name] = handler;
+      return true;
+    }
+    else
+      return false;
+  }
+
+  /**
+    @brief Removes a Key handler from the list.
+    @param name Unique name of the handler.
+    @return True if removal was successful, false if name was not found.
+  */
+  bool InputManager::removeKeyHandler(const std::string &name)
+  {
+    disableKeyHandler(name);
+    std::map<std::string, KeyHandler*>::iterator it = _getSingleton().keyHandlers_.find(name);
+    if (it != _getSingleton().keyHandlers_.end())
+    {
+      _getSingleton().keyHandlers_.erase(it);
+      return true;
+    }
+    else
+      return false;
+  }
+
+  /**
+    @brief Returns the pointer to a handler.
+    @param name Unique name of the handler.
+    @return Pointer to the instance, 0 if name was not found.
+  */
+  KeyHandler* InputManager::getKeyHandler(const std::string& name)
+  {
+    std::map<std::string, KeyHandler*>::iterator it = _getSingleton().keyHandlers_.find(name);
+    if (it != _getSingleton().keyHandlers_.end())
+    {
+      return (*it).second;
+    }
+    else
+      return 0;
+  }
+
+  /**
+    @brief Enables a specific key handler that has already been added.
+    @param name Unique name of the handler.
+    @return False if name was not found, true otherwise.
+  */
+  bool InputManager::enableKeyHandler(const std::string& name)
+  {
+    // get pointer from the map with all stored handlers
+    std::map<std::string, KeyHandler*>::const_iterator mapIt = _getSingleton().keyHandlers_.find(name);
+    if (mapIt == _getSingleton().keyHandlers_.end())
+      return false;
+    // see whether the handler already is in the list
+    for (std::vector<KeyHandler*>::iterator it = _getSingleton().activeKeyHandlers_.begin();
+          it != _getSingleton().activeKeyHandlers_.end(); it++)
+    {
+      if ((*it) == (*mapIt).second)
+      {
+        return true;
+      }
+    }
+    _getSingleton().activeKeyHandlers_.push_back((*mapIt).second);
+    _getSingleton().stateRequest_ = IS_CUSTOM;
+    _getSingleton()._updateTickables();
+    return true;
+  }
+
+  /**
+    @brief Disables a specific key handler.
+    @param name Unique name of the handler.
+    @return False if name was not found, true otherwise.
+  */
+  bool InputManager::disableKeyHandler(const std::string &name)
+  {
+    // get pointer from the map with all stored handlers
+    std::map<std::string, KeyHandler*>::const_iterator mapIt = _getSingleton().keyHandlers_.find(name);
+    if (mapIt == _getSingleton().keyHandlers_.end())
+      return false;
+    // look for the handler in the list
+    for (std::vector<KeyHandler*>::iterator it = _getSingleton().activeKeyHandlers_.begin();
+          it != _getSingleton().activeKeyHandlers_.end(); it++)
+    {
+      if ((*it) == (*mapIt).second)
+      {
+        _getSingleton().activeKeyHandlers_.erase(it);
+        _getSingleton().stateRequest_ = IS_CUSTOM;
+        _getSingleton()._updateTickables();
+        return true;
+      }
+    }
+    return true;
+  }
+
+  /**
+    @brief Checks whether a key handler is active
+    @param name Unique name of the handler.
+    @return False if key handler is not active or doesn't exist, true otherwise.
+  */
+  bool InputManager::isKeyHandlerActive(const std::string& name)
+  {
+    // get pointer from the map with all stored handlers
+    std::map<std::string, KeyHandler*>::const_iterator mapIt = _getSingleton().keyHandlers_.find(name);
+    if (mapIt == _getSingleton().keyHandlers_.end())
+      return false;
+    // see whether the handler already is in the list
+    for (std::vector<KeyHandler*>::iterator it = _getSingleton().activeKeyHandlers_.begin();
+          it != _getSingleton().activeKeyHandlers_.end(); it++)
+    {
+      if ((*it) == (*mapIt).second)
+        return true;
+    }
+    return false;
+  }
+
+
+  // ###### MouseHandler ######
+  /**
+    @brief Adds a new mouse handler.
+    @param handler Pointer to the handler object.
+    @param name Unique name of the handler.
+    @return True if added, false if name already existed.
+  */
+  bool InputManager::addMouseHandler(MouseHandler* handler, const std::string& name)
+  {
+    if (!handler)
+      return false;
+    if (_getSingleton().mouseHandlers_.find(name) == _getSingleton().mouseHandlers_.end())
+    {
+      _getSingleton().mouseHandlers_[name] = handler;
+      return true;
+    }
+    else
+      return false;
+  }
+
+  /**
+    @brief Removes a Mouse handler from the list.
+    @param name Unique name of the handler.
+    @return True if removal was successful, false if name was not found.
+  */
+  bool InputManager::removeMouseHandler(const std::string &name)
+  {
+    disableMouseHandler(name);
+    std::map<std::string, MouseHandler*>::iterator it = _getSingleton().mouseHandlers_.find(name);
+    if (it != _getSingleton().mouseHandlers_.end())
+    {
+      _getSingleton().mouseHandlers_.erase(it);
+      return true;
+    }
+    else
+      return false;
+  }
+
+  /**
+    @brief Returns the pointer to a handler.
+    @param name Unique name of the handler.
+    @return Pointer to the instance, 0 if name was not found.
+  */
+  MouseHandler* InputManager::getMouseHandler(const std::string& name)
+  {
+    std::map<std::string, MouseHandler*>::iterator it = _getSingleton().mouseHandlers_.find(name);
+    if (it != _getSingleton().mouseHandlers_.end())
+    {
+      return (*it).second;
+    }
+    else
+      return 0;
+  }
+
+  /**
+    @brief Enables a specific mouse handler that has already been added.
+    @param name Unique name of the handler.
+    @return False if name was not found, true otherwise.
+  */
+  bool InputManager::enableMouseHandler(const std::string& name)
+  {
+    // get pointer from the map with all stored handlers
+    std::map<std::string, MouseHandler*>::const_iterator mapIt = _getSingleton().mouseHandlers_.find(name);
+    if (mapIt == _getSingleton().mouseHandlers_.end())
+      return false;
+    // see whether the handler already is in the list
+    for (std::vector<MouseHandler*>::iterator it = _getSingleton().activeMouseHandlers_.begin();
+          it != _getSingleton().activeMouseHandlers_.end(); it++)
+    {
+      if ((*it) == (*mapIt).second)
+      {
+        return true;
+      }
+    }
+    _getSingleton().activeMouseHandlers_.push_back((*mapIt).second);
+    _getSingleton().stateRequest_ = IS_CUSTOM;
+    _getSingleton()._updateTickables();
+    return true;
+  }
+
+  /**
+    @brief Disables a specific mouse handler.
+    @param name Unique name of the handler.
+    @return False if name was not found, true otherwise.
+  */
+  bool InputManager::disableMouseHandler(const std::string &name)
+  {
+    // get pointer from the map with all stored handlers
+    std::map<std::string, MouseHandler*>::const_iterator mapIt = _getSingleton().mouseHandlers_.find(name);
+    if (mapIt == _getSingleton().mouseHandlers_.end())
+      return false;
+    // look for the handler in the list
+    for (std::vector<MouseHandler*>::iterator it = _getSingleton().activeMouseHandlers_.begin();
+          it != _getSingleton().activeMouseHandlers_.end(); it++)
+    {
+      if ((*it) == (*mapIt).second)
+      {
+        _getSingleton().activeMouseHandlers_.erase(it);
+        _getSingleton().stateRequest_ = IS_CUSTOM;
+        _getSingleton()._updateTickables();
+        return true;
+      }
+    }
+    return true;
+  }
+
+  /**
+    @brief Checks whether a mouse handler is active
+    @param name Unique name of the handler.
+    @return False if key handler is not active or doesn't exist, true otherwise.
+  */
+  bool InputManager::isMouseHandlerActive(const std::string& name)
+  {
+    // get pointer from the map with all stored handlers
+    std::map<std::string, MouseHandler*>::const_iterator mapIt = _getSingleton().mouseHandlers_.find(name);
+    if (mapIt == _getSingleton().mouseHandlers_.end())
+      return false;
+    // see whether the handler already is in the list
+    for (std::vector<MouseHandler*>::iterator it = _getSingleton().activeMouseHandlers_.begin();
+          it != _getSingleton().activeMouseHandlers_.end(); it++)
+    {
+      if ((*it) == (*mapIt).second)
+        return true;
+    }
+    return false;
+  }
+
+
+  // ###### JoyStickHandler ######
+
+  /**
+    @brief Adds a new joy stick handler.
+    @param handler Pointer to the handler object.
+    @param name Unique name of the handler.
+    @return True if added, false if name already existed.
+  */
+  bool InputManager::addJoyStickHandler(JoyStickHandler* handler, const std::string& name)
+  {
+    if (!handler)
+      return false;
+    if (_getSingleton().joyStickHandlers_.find(name) == _getSingleton().joyStickHandlers_.end())
+    {
+      _getSingleton().joyStickHandlers_[name] = handler;
+      return true;
+    }
+    else
+      return false;
+  }
+
+  /**
+    @brief Removes a JoyStick handler from the list.
+    @param name Unique name of the handler.
+    @return True if removal was successful, false if name was not found.
+  */
+  bool InputManager::removeJoyStickHandler(const std::string &name)
+  {
+    for (std::vector<OIS::JoyStick*>::iterator itstick = _getSingleton().joySticks_.begin();
+          itstick != _getSingleton().joySticks_.end(); itstick++)
+      disableJoyStickHandler(name, itstick - _getSingleton().joySticks_.begin());
+
+    std::map<std::string, JoyStickHandler*>::iterator it = _getSingleton().joyStickHandlers_.find(name);
+    if (it != _getSingleton().joyStickHandlers_.end())
+    {
+      _getSingleton().joyStickHandlers_.erase(it);
+      return true;
+    }
+    else
+      return false;
+  }
+
+  /**
+    @brief Returns the pointer to a handler.
+    @param name Unique name of the handler.
+    @return Pointer to the instance, 0 if name was not found.
+  */
+  JoyStickHandler* InputManager::getJoyStickHandler(const std::string& name)
+  {
+    std::map<std::string, JoyStickHandler*>::iterator it = _getSingleton().joyStickHandlers_.find(name);
+    if (it != _getSingleton().joyStickHandlers_.end())
+    {
+      return (*it).second;
+    }
+    else
+      return 0;
+  }
+
+  /**
+    @brief Enables a specific joy stick handler that has already been added.
+    @param name Unique name of the handler.
+    @return False if name or id was not found, true otherwise.
+  */
+  bool InputManager::enableJoyStickHandler(const std::string& name, unsigned int ID)
+  {
+    // get handler pointer from the map with all stored handlers
+    std::map<std::string, JoyStickHandler*>::const_iterator handlerIt = _getSingleton().joyStickHandlers_.find(name);
+    if (handlerIt == _getSingleton().joyStickHandlers_.end())
+      return false;
+
+    // check for existence of the ID
+    if (ID >= _getSingleton().joySticksSize_)
+      return false;
+
+    // see whether the handler already is in the list
+    for (std::vector<JoyStickHandler*>::iterator it = _getSingleton().activeJoyStickHandlers_[ID].begin();
+          it != _getSingleton().activeJoyStickHandlers_[ID].end(); it++)
+    {
+      if ((*it) == (*handlerIt).second)
+      {
+        return true;
+      }
+    }
+    _getSingleton().activeJoyStickHandlers_[ID].push_back((*handlerIt).second);
+    _getSingleton().stateRequest_ = IS_CUSTOM;
+    _getSingleton()._updateTickables();
+    return true;
+  }
+
+  /**
+    @brief Disables a specific joy stick handler.
+    @param name Unique name of the handler.
+    @return False if name or id was not found, true otherwise.
+  */
+  bool InputManager::disableJoyStickHandler(const std::string &name, unsigned int ID)
+  {
+    // get handler pointer from the map with all stored handlers
+    std::map<std::string, JoyStickHandler*>::const_iterator handlerIt = _getSingleton().joyStickHandlers_.find(name);
+    if (handlerIt == _getSingleton().joyStickHandlers_.end())
+      return false;
+
+    // check for existence of the ID
+    if (ID >= _getSingleton().joySticksSize_)
+      return false;
+
+    // look for the handler in the list
+    for (std::vector<JoyStickHandler*>::iterator it = _getSingleton().activeJoyStickHandlers_[ID].begin();
+          it != _getSingleton().activeJoyStickHandlers_[ID].end(); it++)
+    {
+      if ((*it) == (*handlerIt).second)
+      {
+        _getSingleton().activeJoyStickHandlers_[ID].erase(it);
+        _getSingleton().stateRequest_ = IS_CUSTOM;
+        _getSingleton()._updateTickables();
+        return true;
+      }
+    }
+    return true;
+  }
+
+  /**
+    @brief Checks whether a joy stick handler is active
+    @param name Unique name of the handler.
+    @return False if key handler is not active or doesn't exist, true otherwise.
+  */
+  bool InputManager::isJoyStickHandlerActive(const std::string& name, unsigned int ID)
+  {
+    // get handler pointer from the map with all stored handlers
+    std::map<std::string, JoyStickHandler*>::const_iterator handlerIt = _getSingleton().joyStickHandlers_.find(name);
+    if (handlerIt == _getSingleton().joyStickHandlers_.end())
+      return false;
+
+    // check for existence of the ID
+    if (ID >= _getSingleton().joySticksSize_)
+      return false;
+
+    // see whether the handler already is in the list
+    for (std::vector<JoyStickHandler*>::iterator it = _getSingleton().activeJoyStickHandlers_[ID].begin();
+          it != _getSingleton().activeJoyStickHandlers_[ID].end(); it++)
+    {
+      if ((*it) == (*handlerIt).second)
+        return true;
+    }
+    return false;
+  }
+
+}
Index: /code/trunk/src/core/input/InputManager.h
===================================================================
--- /code/trunk/src/core/input/InputManager.h	(revision 1535)
+++ /code/trunk/src/core/input/InputManager.h	(revision 1535)
@@ -0,0 +1,262 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of a little Input handler that distributes everything
+        coming from OIS.
+ */
+
+#ifndef _InputManager_H__
+#define _InputManager_H__
+
+#include "core/CorePrereqs.h"
+
+#include <map>
+#include <vector>
+
+#include "ois/OIS.h"
+#include "util/Math.h"
+#include "core/OrxonoxClass.h"
+#include "InputInterfaces.h"
+
+namespace orxonox
+{
+  /**
+  * Helper class to realise a vector<int[4]>
+  */
+  class POVStates
+  {
+  public:
+    int operator[](unsigned int index) { return povStates[index]; }
+    int povStates[4];
+  };
+
+  /**
+  * Helper class to realise a vector< {int[4], int[4]} >
+  */
+  class SliderStates
+  {
+  public:
+    IntVector2 sliderStates[4];
+  };
+
+  /**
+  * Struct for storing a custom input state
+  */
+  struct StoredState
+  {
+    std::vector<KeyHandler*>                    activeKeyHandlers_;
+    std::vector<MouseHandler*>                  activeMouseHandlers_;
+    std::vector<std::vector<JoyStickHandler*> > activeJoyStickHandlers_;
+    std::vector<std::pair<InputTickable*, HandlerState> > activeHandlers_;
+  };
+
+  struct JoyStickCalibration
+  {
+    int zeroStates[24];
+    float positiveCoeff[24];
+    float negativeCoeff[24];
+  };
+
+  /**
+    @brief Captures and distributes mouse and keyboard input.
+  */
+  class _CoreExport InputManager
+        : public OrxonoxClass,
+          public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener
+  {
+  public: // enumerations
+    /**
+      @brief Designates the way input is handled and redirected.
+    */
+    enum InputState
+    {
+      IS_UNINIT,    //!< InputManager has not yet been initialised.
+      IS_NONE,      //!< Input is discarded.
+      IS_NORMAL,    //!< Normal play state. Key and button bindings are active.
+      IS_GUI,       //!< All OIS input events are passed to CEGUI.
+      IS_CONSOLE,   //!< Keyboard input is redirected to the InputBuffer.
+      IS_DETECT,    //!< All the input additionally goes to the KeyDetector
+      IS_NODETECT,  //!< remove KeyDetector
+      IS_NOCALIBRATE,
+      IS_CALIBRATE,
+      IS_CUSTOM     //!< Any possible configuration.
+    };
+
+  public: // member functions
+    void setConfigValues();
+
+  public: // static functions
+    static bool initialise(const size_t windowHnd, int windowWidth, int windowHeight,
+          bool createKeyboard = true, bool createMouse = true, bool createJoySticks = false);
+    static bool initialiseKeyboard();
+    static bool initialiseMouse();
+    static bool initialiseJoySticks();
+    static int  numberOfKeyboards();
+    static int  numberOfMice();
+    static int  numberOfJoySticks();
+
+    static void destroy();
+    static void destroyKeyboard();
+    static void destroyMouse();
+    static void destroyJoySticks();
+
+    //static bool isModifierDown(KeyboardModifier::Enum modifier);
+    //static bool isKeyDown(KeyCode::Enum key);
+    //static const MouseState getMouseState();
+    //static const JoyStickState getJoyStickState(unsigned int ID);
+
+    static void setWindowExtents(const int width, const int height);
+
+    static void setInputState(const InputState state);
+    static InputState getInputState();
+
+    static void storeKeyStroke(const std::string& name);
+    static void keyBind(const std::string& command);
+
+    static void calibrate();
+
+    static void tick(float dt);
+
+    static bool addKeyHandler                 (KeyHandler* handler, const std::string& name);
+    static bool removeKeyHandler              (const std::string& name);
+    static KeyHandler* getKeyHandler          (const std::string& name);
+    static bool enableKeyHandler              (const std::string& name);
+    static bool disableKeyHandler             (const std::string& name);
+    static bool isKeyHandlerActive            (const std::string& name);
+
+    static bool addMouseHandler               (MouseHandler* handler, const std::string& name);
+    static bool removeMouseHandler            (const std::string& name);
+    static MouseHandler* getMouseHandler      (const std::string& name);
+    static bool enableMouseHandler            (const std::string& name);
+    static bool disableMouseHandler           (const std::string& name);
+    static bool isMouseHandlerActive          (const std::string& name);
+
+    static bool addJoyStickHandler            (JoyStickHandler* handler, const std::string& name);
+    static bool removeJoyStickHandler         (const std::string& name);
+    static JoyStickHandler* getJoyStickHandler(const std::string& name);
+    static bool enableJoyStickHandler         (const std::string& name, unsigned int id);
+    static bool disableJoyStickHandler        (const std::string& name, unsigned int id);
+    static bool isJoyStickHandlerActive       (const std::string& name, unsigned int id);
+
+  private: // functions
+    // don't mess with a Singleton
+    InputManager ();
+    InputManager (const InputManager&);
+    ~InputManager();
+
+    // Intenal methods
+    bool _initialise(const size_t, int, int, bool, bool, bool);
+    bool _initialiseKeyboard();
+    bool _initialiseMouse();
+    bool _initialiseJoySticks();
+
+    void _destroy();
+    void _destroyKeyboard();
+    void _destroyMouse();
+    void _destroyJoySticks();
+
+    void _updateTickables();
+
+    void _saveState();
+    void _restoreState();
+
+    void _completeCalibration();
+
+    void _fireAxis(unsigned int iJoyStick, int axis, int value);
+    unsigned int _getJoystick(const OIS::JoyStickEvent& arg);
+
+    void _tick(float dt);
+
+    // input events
+    bool mousePressed  (const OIS::MouseEvent    &arg, OIS::MouseButtonID id);
+    bool mouseReleased (const OIS::MouseEvent    &arg, OIS::MouseButtonID id);
+    bool mouseMoved    (const OIS::MouseEvent    &arg);
+    bool keyPressed    (const OIS::KeyEvent      &arg);
+    bool keyReleased   (const OIS::KeyEvent      &arg);
+    bool buttonPressed (const OIS::JoyStickEvent &arg, int button);
+    bool buttonReleased(const OIS::JoyStickEvent &arg, int button);
+    bool axisMoved     (const OIS::JoyStickEvent &arg, int axis);
+    bool sliderMoved   (const OIS::JoyStickEvent &arg, int id);
+    bool povMoved      (const OIS::JoyStickEvent &arg, int id);
+    //bool vector3Moved  (const OIS::JoyStickEvent &arg, int id);
+
+    static InputManager& _getSingleton();
+    static InputManager* _getSingletonPtr() { return &_getSingleton(); }
+
+  private: // variables
+    OIS::InputManager*                          inputSystem_;     //!< OIS input manager
+    OIS::Keyboard*                              keyboard_;        //!< OIS mouse
+    OIS::Mouse*                                 mouse_;           //!< OIS keyboard
+    std::vector<OIS::JoyStick*>                 joySticks_;       //!< OIS joy sticks
+    unsigned int                                joySticksSize_;
+
+    KeyBinder*                                  keyBinder_;       //!< KeyBinder instance
+    KeyDetector*                                keyDetector_;     //!< KeyDetector instance
+    InputBuffer*                                buffer_;          //!< InputBuffer instance
+    CalibratorCallback*                         calibratorCallback_;
+
+    InputState state_;
+    InputState stateRequest_;
+    InputState savedState_;
+    unsigned int keyboardModifiers_;
+    StoredState savedHandlers_;
+
+    // joystick calibration
+    //std::vector<int> marginalsMaxConfig_;
+    //std::vector<int> marginalsMinConfig_;
+    int marginalsMax_[24];
+    int marginalsMin_[24];
+    bool bCalibrated_;
+
+    //! Keeps track of the joy stick POV states
+    std::vector<POVStates>                      povStates_;
+    //! Keeps track of the possibly two slider axes
+    std::vector<SliderStates>                   sliderStates_;
+    std::vector<JoyStickCalibration>            joySticksCalibration_;
+
+    std::map<std::string, KeyHandler*>          keyHandlers_;
+    std::map<std::string, MouseHandler*>        mouseHandlers_;
+    std::map<std::string, JoyStickHandler*>     joyStickHandlers_;
+
+    std::vector<KeyHandler*>                    activeKeyHandlers_;
+    std::vector<MouseHandler*>                  activeMouseHandlers_;
+    std::vector<std::vector<JoyStickHandler*> > activeJoyStickHandlers_;
+    std::vector<std::pair<InputTickable*, HandlerState> > activeHandlers_;
+
+    std::vector<Key>                            keysDown_;
+    std::vector<MouseButton::Enum>              mouseButtonsDown_;
+    std::vector<std::vector<int> >              joyStickButtonsDown_;
+
+    static std::string                          bindingCommmandString_s;
+  };
+
+}
+
+#endif /* _InputManager_H__ */
Index: /code/trunk/src/core/input/KeyBinder.cc
===================================================================
--- /code/trunk/src/core/input/KeyBinder.cc	(revision 1535)
+++ /code/trunk/src/core/input/KeyBinder.cc	(revision 1535)
@@ -0,0 +1,540 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the different input handlers.
+ */
+
+#include "KeyBinder.h"
+#include <fstream>
+#include <string>
+#include "util/Convert.h"
+#include "core/Debug.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/CoreIncludes.h"
+#include "InputCommands.h"
+
+namespace orxonox
+{
+  /**
+    @brief Constructor that does as little as necessary.
+  */
+  KeyBinder::KeyBinder() : deriveTime_(0.0f)
+  {
+    mouseRelative_[0] = 0;
+    mouseRelative_[1] = 0;
+    mousePosition_[0] = 0;
+    mousePosition_[1] = 0;
+
+    RegisterRootObject(KeyBinder);
+
+    // keys
+    std::string keyNames[] = {
+      "UNASSIGNED",
+      "ESCAPE",
+      "1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
+      "MINUS", "EQUALS", "BACK", "TAB",
+      "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P",
+      "LBRACKET", "RBRACKET",
+      "RETURN", "LCONTROL",
+      "A", "S", "D", "F", "G", "H", "J", "K", "L",
+      "SEMICOLON", "APOSTROPHE", "GRAVE",
+      "LSHIFT", "BACKSLASH",
+      "Z", "X", "C", "V", "B", "N", "M",
+      "COMMA", "PERIOD", "SLASH",
+      "RSHIFT",
+      "MULTIPLY",
+      "LMENU",
+      "SPACE",
+      "CAPITAL",
+      "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10",
+      "NUMLOCK", "SCROLL",
+      "NUMPAD7", "NUMPAD8", "NUMPAD9",
+      "SUBTRACT",
+      "NUMPAD4", "NUMPAD5", "NUMPAD6",
+      "ADD",
+      "NUMPAD1", "NUMPAD2", "NUMPAD3", "NUMPAD0",
+      "DECIMAL",
+      "","",
+      "OEM_102",
+      "F11", "F12",
+      "","","","","","","","","","","",
+      "F13", "F14", "F15",
+      "","","","","","","","","","",
+      "KANA",
+      "","",
+      "ABNT_C1",
+      "","","","","",
+      "CONVERT",
+      "",
+      "NOCONVERT",
+      "",
+      "YEN",
+      "ABNT_C2",
+      "","","","","","","","","","","","","","",
+      "NUMPADEQUALS",
+      "","",
+      "PREVTRACK",
+      "AT",
+      "COLON", "UNDERLINE",
+      "KANJI",
+      "STOP",
+      "AX",
+      "UNLABELED",
+      "NEXTTRACK",
+      "","",
+      "NUMPADENTER",
+      "RCONTROL",
+      "","",
+      "MUTE",
+      "CALCULATOR",
+      "PLAYPAUSE",
+      "",
+      "MEDIASTOP",
+      "","","","","","","","","",
+      "VOLUMEDOWN",
+      "",
+      "VOLUMEUP",
+      "",
+      "WEBHOME",
+      "NUMPADCOMMA",
+      "",
+      "DIVIDE",
+      "",
+      "SYSRQ",
+      "RMENU",
+      "","","","","","","","","","","","",
+      "PAUSE",
+      "",
+      "HOME",
+      "UP",
+      "PGUP",
+      "",
+      "LEFT",
+      "",
+      "RIGHT",
+      "",
+      "END", "DOWN", "PGDOWN", "INSERT", "DELETE",
+      "","","","","","","",
+      "LWIN", "RWIN", "APPS",
+      "POWER", "SLEEP",
+      "","","",
+      "WAKE",
+      "",
+      "WEBSEARCH", "WEBFAVORITES", "WEBREFRESH", "WEBSTOP", "WEBFORWARD", "WEBBACK",
+      "MYCOMPUTER", "MAIL", "MEDIASELECT"
+    };
+    for (unsigned int i = 0; i < nKeys_s; i++)
+      keys_[i].name_ = "Key" + keyNames[i];
+
+    // mouse buttons
+    std::string mouseButtonNames[] = {
+      "MouseLeft", "MouseRight", "MouseMiddle",
+      "MouseButton3", "MouseButton4", "MouseButton5",
+      "MouseButton6", "MouseButton7",
+      "MouseWheel1Up", "MouseWheel1Down",
+      "MouseWheel2Up", "MouseWheel2Down" };
+    for (unsigned int i = 0; i < nMouseButtons_s; i++)
+      mouseButtons_[i].name_ = mouseButtonNames[i];
+
+    // joy stick buttons
+    for (unsigned int i = 0; i < 32; i++)
+      joyStickButtons_[i].name_ = "JoyButton" + getConvertedValue<int, std::string>(i);
+    for (unsigned int i = 32; i < nJoyStickButtons_s; i += 4)
+    {
+		  joyStickButtons_[i + 0].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "North";
+		  joyStickButtons_[i + 1].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "South";
+		  joyStickButtons_[i + 2].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "East";
+		  joyStickButtons_[i + 3].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "West";
+    }
+
+    // half axes
+    std::string rawNames[nHalfAxes_s/2];
+    rawNames[0] = "MouseX";
+    rawNames[1] = "MouseY";
+    rawNames[2] = "Empty1";
+    rawNames[3] = "Empty2";
+    for (unsigned int i = 4; i < nHalfAxes_s/2; i++)
+      rawNames[i] = "JoyAxis" + getConvertedValue<int, std::string>(i - 3);
+    for (unsigned int i = 0; i < nHalfAxes_s/2; i++)
+    {
+      halfAxes_[i * 2 + 0].name_ = rawNames[i] + "Pos";
+      halfAxes_[i * 2 + 1].name_ = rawNames[i] + "Neg";
+    }
+
+    for (unsigned int i = 0; i < this->nHalfAxes_s; i++)
+      halfAxes_[i].buttonThreshold_ = buttonThreshold_;
+  }
+
+  /**
+    @brief Destructor
+  */
+  KeyBinder::~KeyBinder()
+  {
+    // almost no destructors required because most of the arrays are static.
+    clearBindings(); // does some destruction work
+  }
+
+  /**
+    @brief Loads the key and button bindings.
+    @return True if loading succeeded.
+  */
+  void KeyBinder::loadBindings()
+  {
+    COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
+
+    clearBindings();
+
+    std::ifstream infile;
+    infile.open("keybindings.ini");
+    if (!infile.is_open())
+    {
+      ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "def_keybindings.ini");
+      ConfigFileManager::getSingleton()->save(CFT_Keybindings, "keybindings.ini");
+    }
+    infile.close();
+    ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini");
+
+    // parse key bindings
+    setConfigValues();
+
+    COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
+  }
+
+  /**
+    @brief Loader for the key bindings, managed by config values.
+  */
+  void KeyBinder::setConfigValues()
+  {
+    SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.01f)  .description("Threshold for analog axes until which the state is 0.");
+    SetConfigValueGeneric(KeyBinder, mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
+    SetConfigValueGeneric(KeyBinder, bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
+    SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.5f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
+    SetConfigValueGeneric(KeyBinder, mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
+    SetConfigValueGeneric(KeyBinder, bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
+
+    float oldThresh = buttonThreshold_;
+    SetConfigValueGeneric(KeyBinder, buttonThreshold_, 0.80f).description("Threshold for analog axes until which the button is not pressed.");
+    if (oldThresh != buttonThreshold_)
+      for (unsigned int i = 0; i < nHalfAxes_s; i++)
+        if (halfAxes_[i].buttonThreshold_ == oldThresh)
+          halfAxes_[i].buttonThreshold_ = buttonThreshold_;
+
+    // keys
+    for (unsigned int i = 0; i < nKeys_s; i++)
+      readTrigger(keys_[i]);
+    // mouse buttons
+    for (unsigned int i = 0; i < nMouseButtons_s; i++)
+      readTrigger(mouseButtons_[i]);
+    // joy stick buttons
+    for (unsigned int i = 0; i < nJoyStickButtons_s; i++)
+      readTrigger(joyStickButtons_[i]);
+    // half axes
+    for (unsigned int i = 0; i < nHalfAxes_s; i++)
+      readTrigger(halfAxes_[i]);
+  }
+
+  void KeyBinder::readTrigger(Button& button)
+  {
+    // config value stuff
+    ConfigValueContainer* cont = ClassManager<KeyBinder>::getIdentifier()->getConfigValueContainer(button.name_);
+    if (!cont)
+    {
+      cont = new ConfigValueContainer(CFT_Keybindings, ClassManager<KeyBinder>::getIdentifier(), button.name_, "");
+      ClassManager<KeyBinder>::getIdentifier()->addConfigValueContainer(button.name_, cont);
+    }
+    std::string old = button.bindingString_;
+    cont->getValue(&button.bindingString_);
+
+    // keybinder stuff
+    if (old != button.bindingString_)
+    {
+      // clear everything so we don't get old axis ParamCommands mixed up
+      button.clear();
+
+      // binding has changed
+      button.parse(paramCommandBuffer_);
+    }
+  }
+
+  /**
+    @brief Overwrites all bindings with ""
+  */
+  void KeyBinder::clearBindings()
+  {
+    for (unsigned int i = 0; i < nKeys_s; i++)
+      keys_[i].clear();
+
+    for (unsigned int i = 0; i < nMouseButtons_s; i++)
+      mouseButtons_[i].clear();
+
+    for (unsigned int i = 0; i < nJoyStickButtons_s; i++)
+      joyStickButtons_[i].clear();
+
+    for (unsigned int i = 0; i < nHalfAxes_s; i++)
+      halfAxes_[i].clear();
+
+    for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
+      delete paramCommandBuffer_[i];
+    paramCommandBuffer_.clear();
+  }
+
+  void KeyBinder::resetJoyStickAxes()
+  {
+    for (unsigned int i = 8; i < nHalfAxes_s; i++)
+    {
+      halfAxes_[i].absVal_ = 0.0f;
+      halfAxes_[i].relVal_ = 0.0f;
+    }
+  }
+
+  void KeyBinder::tickInput(float dt, const HandlerState& state)
+  {
+    // we have to process all the analog input since there is e.g. no 'mouseDoesntMove' event.
+    unsigned int iBegin = 8;
+    unsigned int iEnd   = 8;
+    if (state.joyStick)
+      iEnd = nHalfAxes_s;
+    if (state.mouse)
+      iBegin = 0;
+    for (unsigned int i = iBegin; i < iEnd; i++)
+    {
+      if (halfAxes_[i].hasChanged_)
+      {
+        if (!halfAxes_[i].wasDown_ && halfAxes_[i].absVal_ > halfAxes_[i].buttonThreshold_)
+        {
+          halfAxes_[i].wasDown_ = true;
+          if (halfAxes_[i].nCommands_[KeybindMode::OnPress])
+            halfAxes_[i].execute(KeybindMode::OnPress);
+        }
+        else if (halfAxes_[i].wasDown_ && halfAxes_[i].absVal_ < halfAxes_[i].buttonThreshold_)
+        {
+          halfAxes_[i].wasDown_ = false;
+          if (halfAxes_[i].nCommands_[KeybindMode::OnRelease])
+            halfAxes_[i].execute(KeybindMode::OnRelease);
+        }
+        halfAxes_[i].hasChanged_ = false;
+      }
+
+      if (halfAxes_[i].wasDown_)
+      {
+        if (halfAxes_[i].nCommands_[KeybindMode::OnHold])
+          halfAxes_[i].execute(KeybindMode::OnHold);
+      }
+
+      // these are the actually useful axis bindings for analog input AND output
+      if (halfAxes_[i].relVal_ > analogThreshold_ || halfAxes_[i].absVal_ > analogThreshold_)
+      {
+        //COUT(3) << halfAxes_[i].name_ << "\t" << halfAxes_[i].absVal_ << std::endl;
+        halfAxes_[i].execute();
+      }
+    }
+
+    if (bDeriveMouseInput_ && state.mouse)
+    {
+      if (deriveTime_ > derivePeriod_)
+      {
+        //CCOUT(3) << "mouse abs: ";
+        for (int i = 0; i < 2; i++)
+        {
+          if (mouseRelative_[i] > 0)
+          {
+            halfAxes_[2*i + 0].absVal_ =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
+            halfAxes_[2*i + 1].absVal_ = 0.0f;
+          }
+          else if (mouseRelative_[i] < 0)
+          {
+            halfAxes_[2*i + 0].absVal_ = 0.0f;
+            halfAxes_[2*i + 1].absVal_ = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
+          }
+          else
+          {
+            halfAxes_[2*i + 0].absVal_ = 0.0f;
+            halfAxes_[2*i + 1].absVal_ = 0.0f;
+          }
+          //COUT(3) << mouseRelative_[i] << " | ";
+          mouseRelative_[i] = 0;
+          halfAxes_[2*i + 0].hasChanged_ = true;
+          halfAxes_[2*i + 1].hasChanged_ = true;
+        }
+        deriveTime_ = 0.0f;
+        //COUT(3) << std::endl;
+      }
+      else
+        deriveTime_ += dt;
+    }
+
+    // execute all buffered bindings (addional parameter)
+    for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
+      paramCommandBuffer_[i]->execute();
+
+    // always reset the relative movement of the mouse
+    if (state.mouse)
+      for (unsigned int i = 0; i < 8; i++)
+        halfAxes_[i].relVal_ = 0.0f;
+  }
+
+  void KeyBinder::keyPressed (const KeyEvent& evt)
+  { keys_[evt.key].execute(KeybindMode::OnPress); }
+
+  void KeyBinder::keyReleased(const KeyEvent& evt)
+  { keys_[evt.key].execute(KeybindMode::OnRelease); }
+
+  void KeyBinder::keyHeld    (const KeyEvent& evt)
+  { keys_[evt.key].execute(KeybindMode::OnHold); }
+
+
+  void KeyBinder::mouseButtonPressed (MouseButton::Enum id)
+  { mouseButtons_[id].execute(KeybindMode::OnPress); }
+
+  void KeyBinder::mouseButtonReleased(MouseButton::Enum id)
+  { mouseButtons_[id].execute(KeybindMode::OnRelease); }
+
+  void KeyBinder::mouseButtonHeld    (MouseButton::Enum id)
+  { mouseButtons_[id].execute(KeybindMode::OnHold); }
+
+
+  void KeyBinder::joyStickButtonPressed (int joyStickID, int button)
+  { joyStickButtons_[button].execute(KeybindMode::OnPress); }
+
+  void KeyBinder::joyStickButtonReleased(int joyStickID, int button)
+  { joyStickButtons_[button].execute(KeybindMode::OnRelease); }
+
+  void KeyBinder::joyStickButtonHeld    (int joyStickID, int button)
+  { joyStickButtons_[button].execute(KeybindMode::OnHold); }
+
+  /**
+    @brief Event handler for the mouseMoved Event.
+    @param e Mouse state information
+  */
+  void KeyBinder::mouseMoved(IntVector2 abs_, IntVector2 rel_, IntVector2 clippingSize)
+  {
+    // y axis of mouse input is inverted
+    int rel[] = { rel_.x, -rel_.y };
+
+    if (!bDeriveMouseInput_)
+    {
+      for (int i = 0; i < 2; i++)
+      {
+        if (rel[i])
+        {
+          // absolute
+          halfAxes_[2*i + 0].hasChanged_ = true;
+          halfAxes_[2*i + 1].hasChanged_ = true;
+          mousePosition_[i] += rel[i];
+
+          if (bClipMouse_)
+          {
+            if (mousePosition_[i] > 1024)
+              mousePosition_[i] =  1024;
+            if (mousePosition_[i] < -1024)
+              mousePosition_[i] = -1024;
+          }
+
+          if (mousePosition_[i] >= 0)
+          {
+            halfAxes_[2*i + 0].absVal_ =   mousePosition_[i]/1024.0f * mouseSensitivity_;
+            halfAxes_[2*i + 1].absVal_ =  0.0f;
+          }
+          else
+          {
+            halfAxes_[2*i + 0].absVal_ =  0.0f;
+            halfAxes_[2*i + 1].absVal_ =  -mousePosition_[i]/1024.0f * mouseSensitivity_;
+          }
+        }
+      }
+    }
+    else
+    {
+      mouseRelative_[0] += rel[0];
+      mouseRelative_[1] += rel[1];
+    }
+
+    // relative
+    for (int i = 0; i < 2; i++)
+    {
+      if (rel[i] > 0)
+        halfAxes_[0 + 2*i].relVal_ =  ((float)rel[i])/1024 * mouseSensitivity_;
+      else
+        halfAxes_[1 + 2*i].relVal_ = -((float)rel[i])/1024 * mouseSensitivity_;
+    }
+  }
+
+  /**
+    @brief Event handler for the mouseScrolled Event.
+    @param e Mouse state information
+  */
+  void KeyBinder::mouseScrolled(int abs, int rel)
+  {
+    //COUT(3) << mouseButtons_[8].name_ << "   " << abs << " | " << rel << std::endl;
+
+    if (rel > 0)
+      for (int i = 0; i < rel/120; i++)
+        mouseButtons_[8].execute(KeybindMode::OnPress, ((float)abs)/120.0f);
+    else
+      for (int i = 0; i < -rel/120; i++)
+        mouseButtons_[9].execute(KeybindMode::OnPress, ((float)abs)/120.0f);
+  }
+
+  void KeyBinder::joyStickAxisMoved(int joyStickID, int axis, float value)
+  {
+    // TODO: Use proper calibration values instead of generally 16-bit integer
+    int i = 8 + axis * 2;
+    if (value >= 0)
+    {
+      //if (value > 10000)
+      //{ CCOUT(3) << halfAxes_[i].name_ << std::endl; }
+
+      halfAxes_[i].absVal_ = value;
+      halfAxes_[i].relVal_ = value;
+      halfAxes_[i].hasChanged_ = true;
+      if (halfAxes_[i + 1].absVal_ > 0.0f)
+      {
+        halfAxes_[i + 1].absVal_ = -0.0f;
+        halfAxes_[i + 1].relVal_ = -0.0f;
+        halfAxes_[i + 1].hasChanged_ = true;
+      }
+    }
+    else
+    {
+      //if (value < -10000)
+      //{ CCOUT(3) << halfAxes_[i + 1].name_ << std::endl; }
+
+      halfAxes_[i + 1].absVal_ = -value;
+      halfAxes_[i + 1].relVal_ = -value;
+      halfAxes_[i + 1].hasChanged_ = true;
+      if (halfAxes_[i].absVal_ > 0.0f)
+      {
+        halfAxes_[i].absVal_ = -0.0f;
+        halfAxes_[i].relVal_ = -0.0f;
+        halfAxes_[i].hasChanged_ = true;
+      }
+    }
+  }
+}
Index: /code/trunk/src/core/input/KeyBinder.h
===================================================================
--- /code/trunk/src/core/input/KeyBinder.h	(revision 1535)
+++ /code/trunk/src/core/input/KeyBinder.h	(revision 1535)
@@ -0,0 +1,143 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Different definitions of input processing.
+ */
+
+#ifndef _KeyBinder_H__
+#define _KeyBinder_H__
+
+#include "core/CorePrereqs.h"
+
+#include <vector>
+
+#include "core/OrxonoxClass.h"
+#include "InputInterfaces.h"
+#include "Button.h"
+#include "HalfAxis.h"
+
+namespace orxonox
+{
+  /**
+    @brief Handles mouse, keyboard and joy stick input while in the actual game mode.
+           Manages the key bindings.
+  */
+  class _CoreExport KeyBinder : public KeyHandler, public MouseHandler, public JoyStickHandler, public OrxonoxClass
+  {
+  public:
+    KeyBinder ();
+    virtual ~KeyBinder();
+
+    void loadBindings();
+    void clearBindings();
+    void setConfigValues();
+    void resetJoyStickAxes();
+
+  protected: // functions
+    void tickInput(float dt, const HandlerState& state);
+
+    virtual void readTrigger(Button& button);
+
+    void keyPressed (const KeyEvent& evt);
+    void keyReleased(const KeyEvent& evt);
+    void keyHeld    (const KeyEvent& evt);
+
+    void mouseButtonPressed (MouseButton::Enum id);
+    void mouseButtonReleased(MouseButton::Enum id);
+    void mouseButtonHeld    (MouseButton::Enum id);
+    void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
+    void mouseScrolled      (int abs, int rel);
+
+    void joyStickButtonPressed (int joyStickID, int button);
+    void joyStickButtonReleased(int joyStickID, int button);
+    void joyStickButtonHeld    (int joyStickID, int button);
+    void joyStickAxisMoved     (int joyStickID, int axis, float value);
+
+  protected: // variables
+    //! denotes the number of different keys there are in OIS.
+    static const unsigned int nKeys_s = 0xEE;
+    //! Actual key bindings as bundle for Press, Hold and Release
+    Button keys_ [nKeys_s];
+
+    //! denotes the number of different mouse buttons there are in OIS.
+    static const unsigned int nMouseButtons_s = 8 + 2*2; // 8 buttons and 2 scroll wheels
+    //! Actual key bindings as bundle for Press, Hold and Release
+    Button mouseButtons_ [nMouseButtons_s];
+
+    //! denotes the number of different joy stick buttons there are in OIS.
+    static const unsigned int nJoyStickButtons_s = 32 + 4 * 4; // 32 buttons and 4 POVs with 4 buttons
+    //! Actual key bindings as bundle for Press, Hold and Release
+    Button joyStickButtons_ [nJoyStickButtons_s];
+
+    //! denotes the number of half axes (every axis twice) there can be.
+    static const unsigned int nHalfAxes_s = 56;
+    /**
+    * Array with all the half axes for mouse and joy sticks.
+    * Keep in mind that the positions are fixed and that the first entry is the
+    * positive one and the second is negative.
+    * Sequence is as follows:
+    *  0 -  3: Mouse x and y
+    *  4 -  7: empty
+    *  8 - 23: joy stick slider axes 1 to 8
+    * 24 - 55: joy stick axes 1 - 16
+    */
+    HalfAxis halfAxes_[nHalfAxes_s];
+
+    /**
+    * Commands that have additional parameters (axes) are executed at the end of
+    * the tick() so that all values can be buffered for single execution.
+    */
+    std::vector<BufferedParamCommand*> paramCommandBuffer_;
+
+    //! Keeps track of the absolute mouse value (incl. scroll wheel)
+    int mousePosition_[2];
+    //! Used to derive mouse input if requested
+    int mouseRelative_[2];
+    float deriveTime_;
+
+    //##### ConfigValues #####
+    //! Threshold for analog triggers until which the state is 0.
+    float analogThreshold_;
+    //! Threshold for analog triggers until which the button is not pressed.
+    float buttonThreshold_;
+    //! Derive mouse input for absolute values?
+    bool bDeriveMouseInput_;
+    //! Accuracy of the mouse input deriver. The higher the more precise, but laggier.
+    float derivePeriod_;
+    //! mouse sensitivity
+    float mouseSensitivity_;
+    //! mouse sensitivity if mouse input is derived
+    float mouseSensitivityDerived_;
+    //! Whether or not to clip abslute mouse values to 1024
+    bool bClipMouse_;
+  };
+}
+
+#endif /* _KeyBinder_H__ */
Index: /code/trunk/src/core/input/KeyDetector.cc
===================================================================
--- /code/trunk/src/core/input/KeyDetector.cc	(revision 1535)
+++ /code/trunk/src/core/input/KeyDetector.cc	(revision 1535)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the different input handlers.
+ */
+
+#include "KeyDetector.h"
+#include "core/Debug.h"
+#include "core/CoreIncludes.h"
+#include "core/CommandExecutor.h"
+#include "core/CommandEvaluation.h"
+#include "InputCommands.h"
+#include "Button.h"
+
+namespace orxonox
+{
+  /**
+    @brief Constructor
+  */
+  KeyDetector::KeyDetector()
+  {
+    RegisterObject(KeyDetector);
+  }
+
+  /**
+    @brief Destructor
+  */
+  KeyDetector::~KeyDetector()
+  {
+  }
+
+  /**
+    @brief Loads the key and button bindings.
+    @return True if loading succeeded.
+  */
+  void KeyDetector::loadBindings()
+  {
+    clearBindings();
+    setConfigValues();
+  }
+
+  void KeyDetector::readTrigger(Button& button)
+  {
+    SimpleCommand* cmd = new SimpleCommand();
+    cmd->evaluation_ = CommandExecutor::evaluate("storeKeyStroke " + button.name_);
+    button.commands_[KeybindMode::OnPress] = new BaseCommand*[1];
+    button.commands_[KeybindMode::OnPress][0] = cmd;
+    button.nCommands_[KeybindMode::OnPress] = 1;
+  }
+}
Index: /code/trunk/src/core/input/KeyDetector.h
===================================================================
--- /code/trunk/src/core/input/KeyDetector.h	(revision 1535)
+++ /code/trunk/src/core/input/KeyDetector.h	(revision 1535)
@@ -0,0 +1,55 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Different definitions of input processing.
+ */
+
+#ifndef _KeyDetector_H__
+#define _KeyDetector_H__
+
+#include "core/CorePrereqs.h"
+
+#include "KeyBinder.h"
+
+namespace orxonox
+{
+  class _CoreExport KeyDetector : public KeyBinder
+  {
+  public:
+    KeyDetector();
+    ~KeyDetector();
+    void loadBindings();
+
+  protected:
+    void readTrigger(Button& button);
+  };
+}
+
+#endif /* _KeyDetector_H__ */
Index: /code/trunk/src/network/Client.h
===================================================================
--- /code/trunk/src/network/Client.h	(revision 1534)
+++ /code/trunk/src/network/Client.h	(revision 1535)
@@ -46,5 +46,4 @@
 #include <string>
 
-#include "core/Tickable.h"
 #include "ClientConnection.h"
 #include "PacketManager.h"
@@ -63,5 +62,5 @@
   *
   */
-  class _NetworkExport Client : PacketDecoder, public orxonox::Tickable{
+  class _NetworkExport Client : PacketDecoder{
   public:
     
Index: /code/trunk/src/network/Server.h
===================================================================
--- /code/trunk/src/network/Server.h	(revision 1534)
+++ /code/trunk/src/network/Server.h	(revision 1535)
@@ -46,5 +46,4 @@
 #include <string>
 
-#include "core/Tickable.h"
 #include "PacketManager.h"
 
@@ -59,5 +58,5 @@
   * It implements all functions necessary for a Server
   */
-  class _NetworkExport Server : public PacketDecoder, public orxonox::Tickable{
+  class _NetworkExport Server : public PacketDecoder{
   public:
     static Server *createSingleton();
Index: /code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/CMakeLists.txt	(revision 1534)
+++ /code/trunk/src/orxonox/CMakeLists.txt	(revision 1535)
@@ -3,4 +3,5 @@
   Main.cc
   Orxonox.cc
+  Settings.cc
 
   console/InGameConsole.cc
@@ -29,4 +30,5 @@
   objects/SpaceShip.cc
   objects/SpaceShipAI.cc
+  objects/Tickable.cc
   objects/WorldEntity.cc
 
Index: /code/trunk/src/orxonox/GraphicsEngine.cc
===================================================================
--- /code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1534)
+++ /code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1535)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
  *   Co-authors:
- *      Reto Grieder
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
  *
  */
@@ -35,21 +35,22 @@
 #include "GraphicsEngine.h"
 
+#include <OgreConfigFile.h>
+#include <OgreException.h>
+#include <OgreLogManager.h>
 #include <OgreRoot.h>
-#include <OgreException.h>
-#include <OgreConfigFile.h>
-#include <OgreLogManager.h>
+#include <OgreSceneManager.h>
 #include <OgreTextureManager.h>
-#include "core/InputManager.h"
+#include <OgreViewport.h>
+
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/Debug.h"
 #include "core/CommandExecutor.h"
-#include "core/TclBind.h"
+#include "core/ConsoleCommand.h"
+#include "core/input/InputManager.h"
+
 #include "console/InGameConsole.h"
-
-#include "core/ConsoleCommand.h"
-#include <OgreSceneManager.h>
-#include <OgreCompositorManager.h>
-#include <OgreViewport.h>
+#include "Settings.h"
+
 
 namespace orxonox {
@@ -70,8 +71,5 @@
     root_(0),
     scene_(0),
-    renderWindow_(0),
-    //configPath_(""),
-    dataPath_(""),
-    ogreLogfile_("")
+    renderWindow_(0)
   {
     RegisterObject(GraphicsEngine);
@@ -83,11 +81,12 @@
   void GraphicsEngine::setConfigValues()
   {
-    SetConfigValue(dataPath_, "../../Media/").description("relative path to media data");
-    SetConfigValue(ogreLogfile_, "ogre.log").description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
+    SetConfigValue(resourceFile_,    "resources.cfg").description("Location of the resources file in the data path.");
+    SetConfigValue(ogreConfigFile_,  "ogre.cfg").description("Location of the Ogre config file");
+    SetConfigValue(ogrePluginsFile_, "plugins.cfg").description("Location of the Ogre plugins file");
+    SetConfigValue(ogreLogFile_,     "ogre.log").description("Logfile for messages from Ogre. \
+                                                             Use \"\" to suppress log file creation.");
     SetConfigValue(ogreLogLevelTrivial_ , 5).description("Corresponding orxonox debug level for ogre Trivial");
     SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
     SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
-
-    TclBind::getInstance().setDataPath(this->dataPath_);
   }
 
@@ -126,21 +125,8 @@
     @brief Creates the Ogre Root object and sets up the ogre log.
   */
-  bool GraphicsEngine::setup(std::string& dataPath)
+  bool GraphicsEngine::setup()
   {
     CCOUT(3) << "Setting up..." << std::endl;
     // temporary overwrite of dataPath, change ini file for permanent change
-    if (dataPath != "")
-      dataPath_ = dataPath;
-    if (dataPath_ == "")
-      return false;
-    if (dataPath_[dataPath_.size() - 1] != '/')
-      dataPath_ += "/";
-
-    //TODO: Check if file exists (maybe not here)
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && defined(_DEBUG)
-    std::string plugin_filename = "plugins_d.cfg";
-#else
-    std::string plugin_filename = "plugins.cfg";
-#endif
 
 // TODO: LogManager doesn't work on specific systems. The why is unknown yet.
@@ -154,8 +140,8 @@
     // create our own log that we can listen to
     Ogre::Log *myLog;
-    if (this->ogreLogfile_ == "")
+    if (this->ogreLogFile_ == "")
       myLog = logger->createLog("ogre.log", true, false, true);
     else
-      myLog = logger->createLog(this->ogreLogfile_, true, false, false);
+      myLog = logger->createLog(this->ogreLogFile_, true, false, false);
     CCOUT(4) << "Ogre Log created" << std::endl;
 
@@ -167,5 +153,36 @@
     CCOUT(4) << "Creating Ogre Root..." << std::endl;
 
-    root_ = new Ogre::Root(plugin_filename, "ogre.cfg", this->ogreLogfile_);
+    if (ogrePluginsFile_ == "")
+    {
+      COUT(1) << "Error: Ogre plugins file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+    if (ogreConfigFile_ == "")
+    {
+      COUT(1) << "Error: Ogre config file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+    if (ogreLogFile_ == "")
+    {
+      COUT(1) << "Error: Ogre log file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+
+    try
+    {
+      root_ = new Ogre::Root(ogrePluginsFile_, ogreConfigFile_, ogreLogFile_);
+    }
+    catch (Ogre::Exception ex)
+    {
+      COUT(2) << "Error: There was an exception when creating Ogre Root." << std::endl;
+      return false;
+    }
+
+    if (!root_->getInstalledPlugins().size())
+    {
+      COUT(1) << "Error: No plugins declared. Cannot load Ogre." << std::endl;
+      COUT(0) << "Is the plugins file correctly declared?" << std::endl;
+      return false;
+    }
 
 #if 0
@@ -180,5 +197,6 @@
 
     // specify where Ogre has to look for resources. This call doesn't parse anything yet!
-    declareRessourceLocations();
+    if (!declareRessourceLocations())
+      return false;
 
     CCOUT(3) << "Set up done." << std::endl;
@@ -186,12 +204,28 @@
   }
 
-  void GraphicsEngine::declareRessourceLocations()
+  bool GraphicsEngine::declareRessourceLocations()
   {
     CCOUT(4) << "Declaring Resources" << std::endl;
     //TODO: Specify layout of data file and maybe use xml-loader
     //TODO: Work with ressource groups (should be generated by a special loader)
+
+    if (resourceFile_ == "")
+    {
+      COUT(1) << "Error: Resource file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+
     // Load resource paths from data file using configfile ressource type
     Ogre::ConfigFile cf;
-    cf.load(dataPath_ + "resources.cfg");
+    try
+    {
+      cf.load(Settings::getDataPath() + resourceFile_);
+    }
+    catch (Ogre::Exception ex)
+    {
+      COUT(1) << "Error: Could not load resources.cfg in path " << Settings::getDataPath() << std::endl;
+      COUT(0) << "Have you forgotten to set the data path in orxnox.ini?" << std::endl;
+      return false;
+    }
 
     // Go through all sections & settings in the file
@@ -201,17 +235,24 @@
     while (seci.hasMoreElements())
     {
-      secName = seci.peekNextKey();
-      Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
-      Ogre::ConfigFile::SettingsMultiMap::iterator i;
-      for (i = settings->begin(); i != settings->end(); ++i)
+      try
       {
-        typeName = i->first; // for instance "FileSystem" or "Zip"
-        archName = i->second; // name (and location) of archive
-
-        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-                                           std::string(dataPath_ + archName),
-                                           typeName, secName);
+        secName = seci.peekNextKey();
+        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+        Ogre::ConfigFile::SettingsMultiMap::iterator i;
+        for (i = settings->begin(); i != settings->end(); ++i)
+        {
+          typeName = i->first; // for instance "FileSystem" or "Zip"
+          archName = i->second; // name (and location) of archive
+
+          Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+              std::string(Settings::getDataPath() + archName), typeName, secName);
+        }
       }
-    }
+      catch (Ogre::Exception ex)
+      {
+        COUT(2) << "Exception while reading resources.cfg. Proceeding.." << ex.getDescription() << std::endl;
+      }
+    }
+    return true;
   }
 
@@ -223,8 +264,17 @@
 
     CCOUT(4) << "Creating render window" << std::endl;
-    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
+    try
+    {
+      this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
+    }
+    catch (Ogre::Exception ex)
+    {
+      COUT(2) << "Error: There was an exception when initialising Ogre Root." << std::endl;
+      return false;
+    }
+
     if (!root_->isInitialised())
     {
-      CCOUT(2) << "Error: Creating Ogre root object failed" << std::endl;
+      CCOUT(2) << "Error: Initialising Ogre root object failed." << std::endl;
       return false;
     }
Index: /code/trunk/src/orxonox/GraphicsEngine.h
===================================================================
--- /code/trunk/src/orxonox/GraphicsEngine.h	(revision 1534)
+++ /code/trunk/src/orxonox/GraphicsEngine.h	(revision 1535)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
  *   Co-authors:
- *      Reto Grieder
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
  *
  */
@@ -56,6 +56,6 @@
         public:
             void setConfigValues();
-            bool setup(std::string& dataPath);
-            void declareRessourceLocations();
+            bool setup();
+            bool declareRessourceLocations();
             bool loadRenderer();
             bool initialiseResources();
@@ -65,5 +65,4 @@
 
             Ogre::SceneManager* getSceneManager() { return scene_; }
-            std::string& getDataPath() { return dataPath_; }
 
             // several window properties
@@ -95,14 +94,14 @@
                              bool, const std::string&);
 
-            Ogre::Root*         root_;        //!< Ogre's root
-            Ogre::SceneManager* scene_;       //!< scene manager of the game
-            Ogre::RenderWindow* renderWindow_;//!< the current render window
-            //bool               bOverwritePath_; //!< overwrites path
-            //std::string         configPath_;  //!< path to config file
-            std::string         dataPath_;    //!< path to data file
-            std::string         ogreLogfile_; //!< log file name for Ogre log messages
-            int ogreLogLevelTrivial_;         //!< Corresponding Orxonx debug level for LL_TRIVIAL
-            int ogreLogLevelNormal_;          //!< Corresponding Orxonx debug level for LL_NORMAL
-            int ogreLogLevelCritical_;        //!< Corresponding Orxonx debug level for LL_CRITICAL
+            Ogre::Root*         root_;              //!< Ogre's root
+            Ogre::SceneManager* scene_;             //!< scene manager of the game
+            Ogre::RenderWindow* renderWindow_;      //!< the current render window
+            std::string         resourceFile_;      //!< resources file name
+            std::string         ogreConfigFile_;    //!< ogre config file name
+            std::string         ogrePluginsFile_;   //!< ogre plugins file name
+            std::string         ogreLogFile_;       //!< log file name for Ogre log messages
+            int ogreLogLevelTrivial_;               //!< Corresponding Orxonx debug level for LL_TRIVIAL
+            int ogreLogLevelNormal_;                //!< Corresponding Orxonx debug level for LL_NORMAL
+            int ogreLogLevelCritical_;              //!< Corresponding Orxonx debug level for LL_CRITICAL
     };
 }
Index: /code/trunk/src/orxonox/Main.cc
===================================================================
--- /code/trunk/src/orxonox/Main.cc	(revision 1534)
+++ /code/trunk/src/orxonox/Main.cc	(revision 1535)
@@ -82,5 +82,5 @@
     res = orx->init(argc, argv, macBundlePath());
 #else
-    res = orx->init(argc, argv, "");
+    res = orx->init(argc, argv);
 #endif
 
Index: /code/trunk/src/orxonox/Orxonox.cc
===================================================================
--- /code/trunk/src/orxonox/Orxonox.cc	(revision 1534)
+++ /code/trunk/src/orxonox/Orxonox.cc	(revision 1535)
@@ -21,7 +21,7 @@
  *
  *   Author:
+ *      Reto Grieder
+ *   Co-authors:
  *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
- *   Co-authors:
- *      ...
  *
  */
@@ -57,7 +57,7 @@
 #include "core/Debug.h"
 #include "core/Loader.h"
-#include "core/Tickable.h"
-#include "core/InputManager.h"
+#include "core/input/InputManager.h"
 #include "core/TclBind.h"
+#include "core/Core.h"
 
 // audio
@@ -70,12 +70,13 @@
 // objects and tools
 #include "hud/HUD.h"
-#include <Ogre.h>
+#include "objects/Tickable.h"
 
 #include "GraphicsEngine.h"
+#include "Settings.h"
 
 // FIXME: is this really file scope?
 // globals for the server or client
-network::Client *client_g;
-network::Server *server_g;
+network::Client *client_g = 0;
+network::Server *server_g = 0;
 
 namespace orxonox
@@ -166,19 +167,29 @@
    * @param path path to config (in home dir or something)
    */
-  bool Orxonox::init(int argc, char **argv, std::string path)
-  {
-    //TODO: find config file (assuming executable directory)
-    //TODO: read config file
-    //TODO: give config file to Ogre
+  bool Orxonox::init(int argc, char **argv)
+  {
+#ifdef _DEBUG
+    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox_d.ini");
+#else
+    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
+#endif
+    Factory::createClassHierarchy();
+
     std::string mode;
-    std::string dataPath;
+    std::string tempDataPath;
 
     ArgReader ar(argc, argv);
-    ar.checkArgument("mode", mode, false);
-    ar.checkArgument("data", dataPath, false);
-    ar.checkArgument("ip", serverIp_, false);
-    ar.checkArgument("port", serverPort_, false);
+    ar.checkArgument("mode", &mode, false);
+    ar.checkArgument("data", &tempDataPath, false);
+    ar.checkArgument("ip",   &serverIp_, false);
+    ar.checkArgument("port", &serverPort_, false);
     if(ar.errorHandling())
+    {
+      COUT(1) << "Error while parsing command line arguments" << std::endl;
+      COUT(1) << ar.getErrorString();
+      COUT(0) << "Usage:" << std::endl << "orxonox [mode client|server|dedicated|standalone] "
+        << "[--data PATH] [--ip IP] [--port PORT]" << std::endl;
       return false;
+    }
 
     if (mode == "client")
@@ -190,8 +201,25 @@
     else
     {
-      mode = "standalone";
+      if (mode == "")
+        mode = "standalone";
+      if (mode != "standalone")
+      {
+        COUT(2) << "Warning: mode \"" << mode << "\" doesn't exist. "
+          << "Defaulting to standalone" << std::endl;
+        mode = "standalone";
+      }
       mode_ = STANDALONE;
     }
     COUT(3) << "Orxonox: Mode is " << mode << "." << std::endl;
+
+    if (tempDataPath != "")
+    {
+      if (tempDataPath[tempDataPath.size() - 1] != '/')
+        tempDataPath += "/";
+      Settings::tsetDataPath(tempDataPath);
+    }
+
+    // initialise TCL
+    TclBind::getInstance().setDataPath(Settings::getDataPath());
 
     //if (mode_ == DEDICATED)
@@ -202,9 +230,6 @@
     // procedure until the GUI is identical
 
-    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
-    Factory::createClassHierarchy();
-
     ogre_ = &GraphicsEngine::getSingleton();
-    if (!ogre_->setup(path))       // creates ogre root and other essentials
+    if (!ogre_->setup())       // creates ogre root and other essentials
       return false;
 
@@ -421,4 +446,6 @@
       }
 
+      // tick the core
+      Core::tick((float)evt.timeSinceLastFrame);
       // Call those objects that need the real time
       for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it)
@@ -427,4 +454,9 @@
       for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
         it->tick((float)evt.timeSinceLastFrame * this->timefactor_);
+      //AudioManager::tick();
+      if (client_g)
+        client_g->tick((float)evt.timeSinceLastFrame);
+      if (server_g)
+        server_g->tick((float)evt.timeSinceLastFrame);
 
       // don't forget to call _fireFrameStarted in ogre to make sure
Index: /code/trunk/src/orxonox/Orxonox.h
===================================================================
--- /code/trunk/src/orxonox/Orxonox.h	(revision 1534)
+++ /code/trunk/src/orxonox/Orxonox.h	(revision 1535)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      ...
+ *      Reto Grieder
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
  *
  */
@@ -58,5 +58,5 @@
   {
     public:
-      bool init(int argc, char **argv, std::string path);
+      bool init(int argc, char **argv);
       bool start();
 
Index: /code/trunk/src/orxonox/OrxonoxStableHeaders.h
===================================================================
--- /code/trunk/src/orxonox/OrxonoxStableHeaders.h	(revision 1534)
+++ /code/trunk/src/orxonox/OrxonoxStableHeaders.h	(revision 1535)
@@ -104,5 +104,4 @@
 #include "core/Debug.h"
 //#include "core/Executor.h"
-#include "core/Tickable.h"
 //#include "core/XMLPort.h"
 
@@ -111,4 +110,5 @@
 #include "OrxonoxPrereqs.h"
 #include "tools/Timer.h"
+#include "objects/Tickable.h"
 #include "objects/Model.h"
 #include "objects/WorldEntity.h"
Index: /code/trunk/src/orxonox/Settings.cc
===================================================================
--- /code/trunk/src/orxonox/Settings.cc	(revision 1535)
+++ /code/trunk/src/orxonox/Settings.cc	(revision 1535)
@@ -0,0 +1,105 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Implementation of the Settings class.
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "Settings.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+
+namespace orxonox
+{
+  /**
+    @brief Constructor: Registers the object and sets the config-values.
+  */
+  Settings::Settings()
+  {
+    RegisterRootObject(Settings);
+    setConfigValues();
+  }
+
+  Settings::~Settings()
+  {
+  }
+
+  /**
+    @brief Returns a unique instance of Core.
+    @return The instance
+  */
+  Settings& Settings::getSingleton()
+  {
+    static Settings instance;
+    return instance;
+  }
+
+  /**
+    @brief Function to collect the SetConfigValue-macro calls.
+  */
+  void Settings::setConfigValues()
+  {
+    SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data.");
+    if (dataPath_ != "" && dataPath_[dataPath_.size() - 1] != '/')
+    {
+      ModifyConfigValue(dataPath_, set, dataPath_ + "/");
+    }
+
+    if (dataPath_ == "")
+    {
+      ModifyConfigValue(dataPath_, set, "/");
+      COUT(2) << "Warning: Data path set to \"/\", is that really correct?" << std::endl;
+    }
+  }
+
+  /**
+    @brief Temporary sets the data path
+    @param path The new data path
+  */
+  void Settings::_tsetDataPath(const std::string& path)
+  {
+    ModifyConfigValue(dataPath_, tset, path);
+  }
+
+  /*static*/ void Settings::tsetDataPath(const std::string& path)
+  {
+    getSingleton()._tsetDataPath(path);
+  }
+
+  /**
+    @brief Returns the relative path to the game data.
+    @return The path to the game data
+  */
+  /*static*/ const std::string& Settings::getDataPath()
+  {
+    return getSingleton().dataPath_;
+  }
+}
Index: /code/trunk/src/orxonox/Settings.h
===================================================================
--- /code/trunk/src/orxonox/Settings.h	(revision 1535)
+++ /code/trunk/src/orxonox/Settings.h	(revision 1535)
@@ -0,0 +1,67 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 Core.h
+    @brief Definition of the Settings class.
+
+    The static Settings class is only used to configure some variables
+    through the config-file.
+*/
+
+#ifndef _Settings_H__
+#define _Settings_H__
+
+#include "OrxonoxPrereqs.h"
+#include <string>
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+  class _OrxonoxExport Settings : public OrxonoxClass
+  {
+    public:
+      void setConfigValues();
+
+      static const std::string& getDataPath();
+
+      static void tsetDataPath(const std::string& path);
+
+    private:
+      Settings();
+      Settings(const Settings& instance);
+      ~Settings();
+      static Settings& getSingleton();
+
+      void _tsetDataPath(const std::string& path);
+
+      std::string dataPath_;               //!< Path to the game data
+  };
+}
+
+#endif /* _Settings_H__ */
Index: /code/trunk/src/orxonox/console/InGameConsole.cc
===================================================================
--- /code/trunk/src/orxonox/console/InGameConsole.cc	(revision 1534)
+++ /code/trunk/src/orxonox/console/InGameConsole.cc	(revision 1535)
@@ -42,5 +42,5 @@
 #include "core/ConfigValueIncludes.h"
 #include "core/ConsoleCommand.h"
-#include "core/InputManager.h"
+#include "core/input/InputManager.h"
 #include "util/Math.h"
 #include "GraphicsEngine.h"
Index: /code/trunk/src/orxonox/console/InGameConsole.h
===================================================================
--- /code/trunk/src/orxonox/console/InGameConsole.h	(revision 1534)
+++ /code/trunk/src/orxonox/console/InGameConsole.h	(revision 1535)
@@ -36,6 +36,6 @@
 #include <OgreTextAreaOverlayElement.h>
 
-#include "core/Tickable.h"
 #include "core/Shell.h"
+#include "objects/Tickable.h"
 
 
Index: /code/trunk/src/orxonox/hud/HUD.h
===================================================================
--- /code/trunk/src/orxonox/hud/HUD.h	(revision 1534)
+++ /code/trunk/src/orxonox/hud/HUD.h	(revision 1535)
@@ -36,10 +36,10 @@
 #include <OgreTextAreaOverlayElement.h>
 #include <OgreSceneNode.h>
-#include "core/Tickable.h"
+#include "objects/Tickable.h"
 #include "util/Math.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport HUD : public Tickable
+    class _OrxonoxExport HUD : public TickableReal
     {
       private:
Index: /code/trunk/src/orxonox/hud/RadarOverlayElement.cc
===================================================================
--- /code/trunk/src/orxonox/hud/RadarOverlayElement.cc	(revision 1534)
+++ /code/trunk/src/orxonox/hud/RadarOverlayElement.cc	(revision 1535)
@@ -35,6 +35,6 @@
 
 #include "GraphicsEngine.h"
-#include "core/Tickable.h"
 #include "core/ConsoleCommand.h"
+#include "objects/Tickable.h"
 #include "objects/SpaceShip.h"
 #include "RadarObject.h"
Index: /code/trunk/src/orxonox/objects/SpaceShip.cc
===================================================================
--- /code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1534)
+++ /code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1535)
@@ -42,5 +42,5 @@
 #include "core/Debug.h"
 #include "GraphicsEngine.h"
-#include "core/InputManager.h"
+#include "core/input/InputManager.h"
 #include "particle/ParticleInterface.h"
 #include "Projectile.h"
Index: /code/trunk/src/orxonox/objects/SpaceShip.h
===================================================================
--- /code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1534)
+++ /code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1535)
@@ -34,8 +34,7 @@
 
 #include "util/Math.h"
-#include "core/InputInterfaces.h"
 #include "Camera.h"
 #include "Model.h"
-#include "../tools/BillboardSet.h"
+#include "tools/BillboardSet.h"
 
 namespace orxonox
Index: /code/trunk/src/orxonox/objects/Tickable.cc
===================================================================
--- /code/trunk/src/orxonox/objects/Tickable.cc	(revision 1535)
+++ /code/trunk/src/orxonox/objects/Tickable.cc	(revision 1535)
@@ -0,0 +1,51 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Tickable.h"
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor: Registers the object in the Tickable-list
+    */
+    Tickable::Tickable()
+    {
+        RegisterRootObject(Tickable);
+    }
+
+    /**
+        @brief Constructor: Registers the object in the TickableReal-list
+    */
+    TickableReal::TickableReal()
+    {
+        RegisterRootObject(TickableReal);
+    }
+}
Index: /code/trunk/src/orxonox/objects/Tickable.h
===================================================================
--- /code/trunk/src/orxonox/objects/Tickable.h	(revision 1535)
+++ /code/trunk/src/orxonox/objects/Tickable.h	(revision 1535)
@@ -0,0 +1,80 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/*!
+    @file Tickable.h
+    @brief Definition of the Tickable interface.
+
+    The Tickable interface provides a tick(dt) function, that gets called every frame.
+    float dt is the time since the last frame in seconds.
+
+    Attention:
+    Classes derived from a Tickable that want to have a tick(dt) function on their part, MUST call the
+    parent::tick(dt) function explicitly in their implementation of tick(dt) because it's a virtual function.
+*/
+
+#ifndef _Tickable_H__
+#define _Tickable_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
+    class _OrxonoxExport Tickable : virtual public OrxonoxClass
+    {
+        public:
+            /**
+                @brief Gets called every frame.
+                @param dt The time since the last frame in seconds
+            */
+            virtual void tick(float dt) = 0;
+
+        protected:
+            Tickable();
+    };
+
+    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
+    class _OrxonoxExport TickableReal : virtual public OrxonoxClass
+    {
+        public:
+            /**
+                @brief Gets called every frame.
+                @param dt The time since the last frame in seconds
+            */
+            virtual void tick(float dt) = 0;
+
+        protected:
+            TickableReal();
+    };
+
+}
+
+#endif /* _Tickable_H__ */
Index: /code/trunk/src/orxonox/objects/WorldEntity.h
===================================================================
--- /code/trunk/src/orxonox/objects/WorldEntity.h	(revision 1534)
+++ /code/trunk/src/orxonox/objects/WorldEntity.h	(revision 1535)
@@ -39,5 +39,5 @@
 #include "network/Synchronisable.h"
 #include "core/BaseObject.h"
-#include "core/Tickable.h"
+#include "Tickable.h"
 #include "../tools/Mesh.h"
 
Index: /code/trunk/src/orxonox/tools/Timer.h
===================================================================
--- /code/trunk/src/orxonox/tools/Timer.h	(revision 1534)
+++ /code/trunk/src/orxonox/tools/Timer.h	(revision 1535)
@@ -62,6 +62,5 @@
 
 #include "OrxonoxPrereqs.h"
-#include "core/CorePrereqs.h"
-#include "core/Tickable.h"
+#include "objects/Tickable.h"
 
 namespace orxonox
Index: /code/trunk/src/util/ArgReader.cc
===================================================================
--- /code/trunk/src/util/ArgReader.cc	(revision 1534)
+++ /code/trunk/src/util/ArgReader.cc	(revision 1535)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht <beni_at_orxonox.net>
  *
  */
@@ -33,78 +33,62 @@
 
 #include "ArgReader.h"
+#include "SubString.h"
 
-#include <iostream>
+ArgReader::ArgReader(int argc, char **argv)
+{
+  failure_ = false;
+  errorString_ = "";
+  CmdLineArg arg;
 
-ArgReader::ArgReader(int argc, char** argv)
-{
-  counter_ = argc;
-  arguments_ = argv;
-  fail_ = false;
-  errorStr_ = "";
-}
+  int i = 1;
+  while (i < argc)
+  {
+    if (argv[i][0] == '-' && argv[i][1] == '-') // name
+    {
+      if (argv[i][2] == '\0')
+      {
+        failure_ = true;
+        errorString_ += "Expected word after \"--\".\n";
+      }
+      arg.bChecked_ = false;
+      arg.name_ = argv[i] + 2;
+      arg.value_ = "";
+      arguments_.push_back(arg);
+    }
+    else // value
+    {
+      if (arguments_.size() == 0)
+      {
+        failure_ = true;
+        errorString_ += "Expected \"--\" in command line arguments.\n";
+        arg.bChecked_ = false;
+        arg.name_ = "";
+        arg.value_ = "";
+        arguments_.push_back(arg);
+      }
 
-void ArgReader::checkArgument(std::string option, std::string &string, bool must)
-{
-  int argpos = checkOption(option) + 1;
-  if(argpos != 0)
-  {
-    string = arguments_[argpos];
+      if (arguments_.back().value_ != "")
+        arguments_.back().value_ += " " + std::string(argv[i]);
+      else
+        arguments_.back().value_ = argv[i];
+    }
+    ++i;
   }
-  else
-  {
-    if(must) {
-      errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
-      fail_ = true;
-    }
-  }
-
-}
-
-void ArgReader::checkArgument(std::string option, int &integer, bool must)
-{
-  int argpos = checkOption(option) + 1;
-  if(argpos != 0)
-  {
-    integer = atoi(arguments_[argpos]);
-  }
-  else
-  {
-    if(must) {
-      errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
-      fail_ = true;
-    }
-  }
-}
-
-void ArgReader::checkArgument(std::string option, float &floating, bool must)
-{
-  int argpos = checkOption(option) + 1;
-  if(argpos != 0)
-  {
-    floating = (float)atof(arguments_[argpos]);
-  }
-  else
-  {
-    if(must) {
-      errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
-      fail_ = true;
-    }
-  }
-}
-
-int ArgReader::checkOption(std::string option)
-{
-  for(int i = 1; i < counter_; i++)
-  {
-    if(arguments_[i] == "--" + option)
-        return i;
-  }
-  return -1;
 }
 
 bool ArgReader::errorHandling()
 {
-  if(fail_)
-    std::cout << errorStr_;
-  return fail_;
+  bool argumentsChecked = true;
+  for (unsigned int i = 1; i < arguments_.size(); ++i)
+    argumentsChecked &= arguments_[i].bChecked_;
+
+  if (!argumentsChecked)
+    errorString_ += "Not all arguments could be matched.\n";
+
+  return !argumentsChecked || failure_;
 }
+
+const std::string& ArgReader::getErrorString()
+{
+  return errorString_;
+}
Index: /code/trunk/src/util/ArgReader.h
===================================================================
--- /code/trunk/src/util/ArgReader.h	(revision 1534)
+++ /code/trunk/src/util/ArgReader.h	(revision 1535)
@@ -21,7 +21,7 @@
  *
  *   Author:
+ *      Reto Grieder
+ *   Co-authors:
  *      Benjamin Knecht <beni_at_orxonox.net>
- *   Co-authors:
- *      ...
  *
  */
@@ -39,4 +39,13 @@
 
 #include <string>
+#include <vector>
+#include "Convert.h"
+
+struct _UtilExport CmdLineArg
+{
+  std::string name_;
+  std::string value_;
+  bool bChecked_;
+};
 
 class _UtilExport ArgReader
@@ -44,17 +53,64 @@
   public:
     ArgReader(int argc, char **argv);
-    void checkArgument(std::string option, std::string& string, bool must=false);
-    void checkArgument(std::string option, int& integer, bool must=false);
-    void checkArgument(std::string option, float& floating, bool must=false);
+    template <class T>
+    void checkArgument(std::string option, T* value, bool must = false);
     bool errorHandling();
-  private:
-    int checkOption(std::string option);
+    const std::string& getErrorString();
 
   private:
-    int counter_;
-    char **arguments_;
-    bool fail_;
-    std::string errorStr_;
+    std::vector<CmdLineArg> arguments_;
+    bool failure_;
+    std::string errorString_;
 };
 
+template <class T>
+void ArgReader::checkArgument(std::string option, T* value, bool must)
+{
+  unsigned int iArg = 0;
+  while (iArg < arguments_.size())
+  {
+    if (arguments_[iArg].name_ == option)
+      break;
+    ++iArg;
+  }
+  if (iArg == arguments_.size())
+  {
+    if (must)
+    {
+      failure_ = true;
+      errorString_ += "Cannot find mandatory argument \"" + option + "\"\n";
+      return;
+    }
+    else
+      return;
+  }
+
+  arguments_[iArg].bChecked_ = true;
+
+  if (!convertValue(value, arguments_[iArg].value_))
+  {
+    failure_ = true;
+    errorString_ += "Cannot convert argument value for option \"" + option + "\"\n";
+  }
+}
+
+template <>
+void ArgReader::checkArgument(std::string option, bool* value, bool must)
+{
+  // for type bool, only check whether the option was set or not
+  unsigned int iArg = 0;
+  while (iArg < arguments_.size())
+  {
+    if (arguments_[iArg].name_ == option)
+    {
+      arguments_[iArg].bChecked_ = true;
+      *value = true;
+      break;
+    }
+    ++iArg;
+  }
+  if (iArg == arguments_.size())
+    *value = false;
+}
+
 #endif /* _ArgReader_H__ */
Index: /code/trunk/visual_studio/vc8/core.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/core.vcproj	(revision 1534)
+++ /code/trunk/visual_studio/vc8/core.vcproj	(revision 1535)
@@ -157,5 +157,5 @@
 			</File>
 			<File
-				RelativePath="..\..\src\core\CoreSettings.cc"
+				RelativePath="..\..\src\core\Core.cc"
 				>
 			</File>
@@ -188,8 +188,4 @@
 				>
 			</File>
-			<File
-				RelativePath="..\..\src\core\Tickable.cc"
-				>
-			</File>
 			<Filter
 				Name="tolua"
@@ -280,13 +276,33 @@
 				>
 				<File
-					RelativePath="..\..\src\core\InputBuffer.cc"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\core\InputManager.cc"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\core\KeyBinder.cc"
+					RelativePath="..\..\src\core\input\Button.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\CalibratorCallback.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\HalfAxis.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\InputBuffer.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\InputCommands.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\InputManager.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\KeyBinder.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\KeyDetector.cc"
 					>
 				</File>
@@ -331,12 +347,12 @@
 			</File>
 			<File
+				RelativePath="..\..\src\core\Core.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\core\CorePrereqs.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\core\CoreSettings.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\core\Debug.h"
 				>
@@ -374,25 +390,41 @@
 				>
 			</File>
-			<File
-				RelativePath="..\..\src\core\Tickable.h"
-				>
-			</File>
 			<Filter
 				Name="input"
 				>
 				<File
-					RelativePath="..\..\src\core\InputBuffer.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\core\InputInterfaces.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\core\InputManager.h"
-					>
-				</File>
-				<File
-					RelativePath="..\..\src\core\KeyBinder.h"
+					RelativePath="..\..\src\core\input\Button.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\CalibratorCallback.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\HalfAxis.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\InputBuffer.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\InputCommands.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\InputInterfaces.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\InputManager.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\KeyBinder.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\core\input\KeyDetector.h"
 					>
 				</File>
Index: /code/trunk/visual_studio/vc8/orxonox.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/orxonox.vcproj	(revision 1534)
+++ /code/trunk/visual_studio/vc8/orxonox.vcproj	(revision 1535)
@@ -184,4 +184,8 @@
 				</FileConfiguration>
 			</File>
+			<File
+				RelativePath="..\..\src\orxonox\Settings.cc"
+				>
+			</File>
 			<Filter
 				Name="hud"
@@ -253,4 +257,8 @@
 				<File
 					RelativePath="..\..\src\orxonox\objects\SpaceShipAI.cc"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\Tickable.cc"
 					>
 				</File>
@@ -466,4 +474,8 @@
 				>
 			</File>
+			<File
+				RelativePath="..\..\src\orxonox\Settings.h"
+				>
+			</File>
 			<Filter
 				Name="hud"
@@ -539,4 +551,8 @@
 				<File
 					RelativePath="..\..\src\orxonox\objects\SpaceShipAI.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\orxonox\objects\Tickable.h"
 					>
 				</File>
