Index: code/branches/gui/src/core/Core.cc
===================================================================
--- code/branches/gui/src/core/Core.cc	(revision 1641)
+++ code/branches/gui/src/core/Core.cc	(revision 1642)
@@ -196,5 +196,5 @@
     {
         TclThreadManager::getInstance().tick(dt);
-        InputManager::tick(dt);
+        InputManager::getInstance().tick(dt);
     }
 }
Index: code/branches/gui/src/core/Exception.h
===================================================================
--- code/branches/gui/src/core/Exception.h	(revision 1641)
+++ code/branches/gui/src/core/Exception.h	(revision 1642)
@@ -40,4 +40,5 @@
 #include <string>
 #include <exception>
+#include <cassert>
 #include "core/Debug.h"
 
@@ -129,4 +130,13 @@
     throw SpecificException<Exception::type>(description, __LINE__, __FILE__, __FUNCTIONNAME__)
 
+    // define an assert macro that can display a message
+#ifndef NDEBUG
+#define OrxAssert(condition, errorMessage) \
+    condition ? ((void)0) : (orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << errorMessage << std::endl); \
+    assert(condition);
+#else
+#define OrxAssert(condition, errorMessage)  ((void)0)
+#endif
+
 }
 
Index: code/branches/gui/src/core/input/ExtendedInputState.cc
===================================================================
--- code/branches/gui/src/core/input/ExtendedInputState.cc	(revision 1641)
+++ code/branches/gui/src/core/input/ExtendedInputState.cc	(revision 1642)
@@ -37,8 +37,16 @@
 #include <assert.h>
 #include "core/Debug.h"
+#include "core/CoreIncludes.h"
 
 namespace orxonox
 {
+    CreateFactory(ExtendedInputState);
+
     using namespace InputDevice;
+
+    ExtendedInputState::ExtendedInputState()
+    {
+        RegisterObject(ExtendedInputState);
+    }
 
     void ExtendedInputState::numberOfJoySticksChanged(unsigned int n)
Index: code/branches/gui/src/core/input/ExtendedInputState.h
===================================================================
--- code/branches/gui/src/core/input/ExtendedInputState.h	(revision 1641)
+++ code/branches/gui/src/core/input/ExtendedInputState.h	(revision 1642)
@@ -48,5 +48,5 @@
     {
     public:
-        ExtendedInputState() { }
+        ExtendedInputState();
         ~ExtendedInputState() { }
 
Index: code/branches/gui/src/core/input/InputManager.cc
===================================================================
--- code/branches/gui/src/core/input/InputManager.cc	(revision 1641)
+++ code/branches/gui/src/core/input/InputManager.cc	(revision 1642)
@@ -62,10 +62,13 @@
     SetConsoleCommandShortcut(InputManager, calibrate);
 
+    std::string InputManager::bindingCommmandString_s = "";
+    InputManager* InputManager::singletonRef_s = 0;
+
     using namespace InputDevice;
 
-    // ###############################
-    // ###    Internal Methods     ###
-    // ###############################
-    // ###############################
+    // ############################################################
+    // #####                  Initialisation                  #####
+    // ##########                                        ##########
+    // ############################################################
 
     /**
@@ -87,34 +90,8 @@
     {
         RegisterRootObject(InputManager);
-    }
-
-    /**
-    @brief
-        Destructor itself only called at the end of the program, after main.
-        Instance gets registered for destruction with atexit(.).
-    */
-    InputManager::~InputManager()
-    {
-        _destroy();
-    }
-
-    /**
-    @brief
-        The one instance of the InputManager is stored in this function.
-        Only for internal use. Public Interface ist static.
-    @return
-        A reference to the only instance of the InputManager
-    */
-    InputManager& InputManager::_getInstance()
-    {
-        static InputManager theOnlyInstance;
-        return theOnlyInstance;
-    }
-
-
-    // ############################################################
-    // #####                  Initialisation                  #####
-    // ##########                                        ##########
-    // ############################################################
+
+        assert(singletonRef_s == 0);
+        singletonRef_s = this;
+    }
 
     /**
@@ -129,5 +106,5 @@
         The height of the render window
     */
-    bool InputManager::_initialise(const size_t windowHnd, int windowWidth, int windowHeight,
+    bool InputManager::initialise(const size_t windowHnd, int windowWidth, int windowHeight,
                                    bool createKeyboard, bool createMouse, bool createJoySticks)
     {
@@ -431,8 +408,7 @@
     /**
     @brief
-        Destroys all the created input devices. InputManager will be ready for a
-        new initialisation.
-    */
-    void InputManager::_destroy()
+        Destroys all the created input devices and states.
+    */
+    InputManager::~InputManager()
     {
         if (inputSystem_)
@@ -550,5 +526,5 @@
         Delta time
     */
-    void InputManager::_tick(float dt)
+    void InputManager::tick(float dt)
     {
         if (inputSystem_ == 0)
@@ -983,75 +959,7 @@
 
     // ############################################################
-    // #####            Static Interface Methods              #####
+    // #####         Other Public 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 _getInstance()._initialise(windowHnd, windowWidth, windowHeight,
-            createKeyboard, createMouse, createJoySticks);
-    }
-
-    int InputManager::numberOfKeyboards()
-    {
-        if (_getInstance().keyboard_ != 0)
-            return 1;
-        else
-            return 0;
-    }
-
-    int InputManager::numberOfMice()
-    {
-        if (_getInstance().mouse_ != 0)
-            return 1;
-        else
-            return 0;
-    }
-
-    int InputManager::numberOfJoySticks()
-    {
-        return _getInstance().joySticksSize_;
-    }
-
-    /*bool InputManager::isKeyDown(KeyCode::Enum key)
-    {
-    if (_getInstance().keyboard_)
-        return _getInstance().keyboard_->isKeyDown((OIS::KeyCode)key);
-    else
-        return false;
-    }*/
-
-    /*bool InputManager::isModifierDown(KeyboardModifier::Enum modifier)
-    {
-    if (_getInstance().keyboard_)
-        return isModifierDown(modifier);
-    else
-        return false;
-    }*/
-
-    /*const MouseState InputManager::getMouseState()
-    {
-    if (_getInstance().mouse_)
-        return _getInstance().mouse_->getMouseState();
-    else
-        return MouseState();
-    }*/
-
-    /*const JoyStickState InputManager::getJoyStickState(unsigned int ID)
-    {
-    if (ID < _getInstance().joySticksSize_)
-        return JoyStickState(_getInstance().joySticks_[ID]->getJoyStickState(), ID);
-    else
-        return JoyStickState();
-    }*/
-
-    void InputManager::destroy()
-    {
-        _getInstance()._destroy();
-    }
-
 
     /**
@@ -1066,58 +974,12 @@
     void InputManager::setWindowExtents(const int width, const int height)
     {
-        if (_getInstance().mouse_)
+        if (mouse_)
         {
             // Set mouse region (if window resizes, we should alter this to reflect as well)
-            const OIS::MouseState &mouseState = _getInstance().mouse_->getMouseState();
-            mouseState.width  = width;
-            mouseState.height = height;
-        }
-    }
-
-    /**
-    @brief
-        Method for easily storing a string with the command executor. It is used by the
-        KeyDetector to get assign commands. The KeyDetector simply executes
-        the command 'storeKeyStroke myName' for each button/axis.
-    @remarks
-        This is only a temporary hack until we thourouhgly support multiple KeyBinders.
-    @param name
-        The name of the button/axis.
-    */
-    void InputManager::storeKeyStroke(const std::string& name)
-    {
-        requestLeaveState("detector");
-        COUT(0) << "Binding string \"" << bindingCommmandString_s << "\" on key '" << name << "'" << std::endl;
-        CommandExecutor::execute("config KeyBinder " + name + " " + bindingCommmandString_s, false);
-    }
-
-    /**
-    @brief
-        Assigns a command string to a key/button/axis. The name is determined via KeyDetector
-        and InputManager::storeKeyStroke(.).
-    @param command
-        Command string that can be executed by the CommandExecutor
-    */
-    void InputManager::keyBind(const std::string& command)
-    {
-        bindingCommmandString_s = command;
-        requestEnterState("detector");
-        COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
-    }
-
-    /**
-    @brief
-        Starts joy stick calibration.
-    */
-    void InputManager::calibrate()
-    {
-        _getInstance().bCalibrating_ = true;
-        requestEnterState("calibrator");
-    }
-
-    void InputManager::tick(float dt)
-    {
-        _getInstance()._tick(dt);
-    }
+            mouse_->getMouseState().width  = width;
+            mouse_->getMouseState().height = height;
+        }
+    }
+
 
     // ###### InputStates ######
@@ -1139,11 +1001,13 @@
         if (name == "")
             return false;
-        if (_getInstance().inputStatesByName_.find(name) == _getInstance().inputStatesByName_.end())
-        {
-            if (_getInstance().inputStatesByPriority_.find(priority)
-                == _getInstance().inputStatesByPriority_.end())
-            {
-                _getInstance().inputStatesByName_[name] = state;
-                _getInstance().inputStatesByPriority_[priority] = state;
+        if (!state)
+            return false;
+        if (inputStatesByName_.find(name) == inputStatesByName_.end())
+        {
+            if (inputStatesByPriority_.find(priority)
+                == inputStatesByPriority_.end())
+            {
+                inputStatesByName_[name] = state;
+                inputStatesByPriority_[priority] = state;
                 state->setNumOfJoySticks(numberOfJoySticks());
                 state->setName(name);
@@ -1172,5 +1036,5 @@
     {
         SimpleInputState* state = new SimpleInputState();
-        if (_getInstance()._configureInputState(state, name, priority))
+        if (_configureInputState(state, name, priority))
             return state;
         else
@@ -1188,5 +1052,23 @@
     {
         ExtendedInputState* state = new ExtendedInputState();
-        if (_getInstance()._configureInputState(state, name, priority))
+        if (_configureInputState(state, name, priority))
+            return state;
+        else
+        {
+            delete state;
+            return 0;
+        }
+    }
+
+    /**
+    @brief
+        Returns a new InputState of type 'type' and configures it first.
+    @param type
+        String name of the class (used by the factory)
+    */
+    InputState* InputManager::createInputState(const std::string& type, const std::string &name, int priority)
+    {
+        InputState* state = dynamic_cast<InputState*>(Factory::getIdentifier(type)->fabricate());
+        if (_configureInputState(state, name, priority))
             return state;
         else
@@ -1214,8 +1096,8 @@
             return false;
         }
-        std::map<std::string, InputState*>::iterator it = _getInstance().inputStatesByName_.find(name);
-        if (it != _getInstance().inputStatesByName_.end())
-        {
-            _getInstance()._destroyState((*it).second);
+        std::map<std::string, InputState*>::iterator it = inputStatesByName_.find(name);
+        if (it != inputStatesByName_.end())
+        {
+            _destroyState((*it).second);
             return true;
         }
@@ -1233,6 +1115,6 @@
     InputState* InputManager::getState(const std::string& name)
     {
-        std::map<std::string, InputState*>::iterator it = _getInstance().inputStatesByName_.find(name);
-        if (it != _getInstance().inputStatesByName_.end())
+        std::map<std::string, InputState*>::iterator it = inputStatesByName_.find(name);
+        if (it != inputStatesByName_.end())
             return (*it).second;
         else
@@ -1248,5 +1130,5 @@
     InputState* InputManager::getCurrentState()
     {
-        return (*_getInstance().activeStates_.rbegin()).second;
+        return (*activeStates_.rbegin()).second;
     }
 
@@ -1263,8 +1145,8 @@
     {
         // get pointer from the map with all stored handlers
-        std::map<std::string, InputState*>::const_iterator it = _getInstance().inputStatesByName_.find(name);
-        if (it != _getInstance().inputStatesByName_.end())
-        {
-            _getInstance().stateEnterRequests_.push_back((*it).second);
+        std::map<std::string, InputState*>::const_iterator it = inputStatesByName_.find(name);
+        if (it != inputStatesByName_.end())
+        {
+            stateEnterRequests_.push_back((*it).second);
             return true;
         }
@@ -1283,11 +1165,58 @@
     {
         // get pointer from the map with all stored handlers
-        std::map<std::string, InputState*>::const_iterator it = _getInstance().inputStatesByName_.find(name);
-        if (it != _getInstance().inputStatesByName_.end())
-        {
-            _getInstance().stateLeaveRequests_.push_back((*it).second);
+        std::map<std::string, InputState*>::const_iterator it = inputStatesByName_.find(name);
+        if (it != inputStatesByName_.end())
+        {
+            stateLeaveRequests_.push_back((*it).second);
             return true;
         }
         return false;
     }
+
+
+    // ############################################################
+    // #####                Console Commands                  #####
+    // ##########                                        ##########
+    // ############################################################
+
+    /**
+    @brief
+        Method for easily storing a string with the command executor. It is used by the
+        KeyDetector to get assign commands. The KeyDetector simply executes
+        the command 'storeKeyStroke myName' for each button/axis.
+    @remarks
+        This is only a temporary hack until we thourouhgly support multiple KeyBinders.
+    @param name
+        The name of the button/axis.
+    */
+    void InputManager::storeKeyStroke(const std::string& name)
+    {
+        getInstance().requestLeaveState("detector");
+        COUT(0) << "Binding string \"" << bindingCommmandString_s << "\" on key '" << name << "'" << std::endl;
+        CommandExecutor::execute("config KeyBinder " + name + " " + bindingCommmandString_s, false);
+    }
+
+    /**
+    @brief
+        Assigns a command string to a key/button/axis. The name is determined via KeyDetector
+        and InputManager::storeKeyStroke(.).
+    @param command
+        Command string that can be executed by the CommandExecutor
+    */
+    void InputManager::keyBind(const std::string& command)
+    {
+        bindingCommmandString_s = command;
+        getInstance().requestEnterState("detector");
+        COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
+    }
+
+    /**
+    @brief
+        Starts joy stick calibration.
+    */
+    void InputManager::calibrate()
+    {
+        getInstance().bCalibrating_ = true;
+        getInstance().requestEnterState("calibrator");
+    }
 }
Index: code/branches/gui/src/core/input/InputManager.h
===================================================================
--- code/branches/gui/src/core/input/InputManager.h	(revision 1641)
+++ code/branches/gui/src/core/input/InputManager.h	(revision 1642)
@@ -86,44 +86,42 @@
         // --> setConfigValues is private
         friend ClassIdentifier<InputManager>;
-
-    public: // static functions
-        static bool initialise(const size_t windowHnd, int windowWidth, int windowHeight,
+        // let Core class use tick(.)
+        friend Core;
+
+    public:
+        InputManager ();
+        ~InputManager();
+
+        bool initialise(const size_t windowHnd, int windowWidth, int windowHeight,
                                bool createKeyboard = true, bool createMouse = true, bool createJoySticks = false);
-        static int  numberOfKeyboards();
-        static int  numberOfMice();
-        static int  numberOfJoySticks();
-
-        static void destroy();
-
-        //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);
-
+
+        int  numberOfKeyboards() { return keyboard_ ? 1 : 0; }
+        int  numberOfMice()      { return mouse_    ? 1 : 0; }
+        int  numberOfJoySticks() { return joySticksSize_; }
+
+        void setWindowExtents(const int width, const int height);
+
+        SimpleInputState*   createSimpleInputState  (const std::string& name, int priority);
+        ExtendedInputState* createExtendedInputState(const std::string& name, int priority);
+        InputState*         createInputState(const std::string& type, const std::string &name, int priority);
+        bool destroyState          (const std::string& name);
+        InputState* getState       (const std::string& name);
+        InputState* getCurrentState();
+        bool requestEnterState     (const std::string& name);
+        bool requestLeaveState     (const std::string& name);
+
+        static InputManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; }
+        static InputManager* getInstancePtr() { return singletonRef_s; }
+
+    public: // console commands
         static void storeKeyStroke(const std::string& name);
         static void keyBind(const std::string& command);
-
         static void calibrate();
-
-        static void tick(float dt);
-
-        static SimpleInputState*   createSimpleInputState  (const std::string& name, int priority);
-        static ExtendedInputState* createExtendedInputState(const std::string& name, int priority);
-        static bool destroyState (const std::string& name);
-        static InputState* getState       (const std::string& name);
-        static InputState* getCurrentState();
-        static bool requestEnterState     (const std::string& name);
-        static bool requestLeaveState     (const std::string& name);
 
     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();
@@ -131,5 +129,4 @@
         void _redimensionLists();
 
-        void _destroy();
         void _destroyKeyboard();
         void _destroyMouse();
@@ -142,8 +139,8 @@
         unsigned int _getJoystick(const OIS::JoyStickEvent& arg);
 
-        void _tick(float dt);
-
         void _updateActiveStates();
         bool _configureInputState(InputState* state, const std::string& name, int priority);
+
+        void tick(float dt);
 
         // input events
@@ -158,8 +155,8 @@
         bool sliderMoved   (const OIS::JoyStickEvent &arg, int id);
         bool povMoved      (const OIS::JoyStickEvent &arg, int id);
+        // don't remove that! Or else add OIS as dependency library to orxonox.
+        bool vector3Moved  (const OIS::JoyStickEvent &arg, int id) { return true; }
 
         void setConfigValues();
-
-        static InputManager& _getInstance();
 
     private: // variables
@@ -204,6 +201,6 @@
 
         static std::string                  bindingCommmandString_s;
-    };
-
+        static InputManager*                singletonRef_s;
+    };
 }
 
Index: code/branches/gui/src/core/input/InputState.h
===================================================================
--- code/branches/gui/src/core/input/InputState.h	(revision 1641)
+++ code/branches/gui/src/core/input/InputState.h	(revision 1642)
@@ -40,14 +40,17 @@
 #include <vector>
 #include "core/Executor.h"
+#include "core/BaseObject.h"
+#include "core/CoreIncludes.h"
 #include "InputInterfaces.h"
 
 namespace orxonox
 {
-    class _CoreExport InputState
+    class _CoreExport InputState : public BaseObject
     {
         friend class InputManager;
 
     public:
-        InputState() : priority_(0), executorOnEnter_(0), executorOnLeave_(0) { }
+        InputState() : priority_(0), executorOnEnter_(0), executorOnLeave_(0)
+        { RegisterObject(InputState); }
         virtual ~InputState() { }
 
Index: code/branches/gui/src/core/input/SimpleInputState.cc
===================================================================
--- code/branches/gui/src/core/input/SimpleInputState.cc	(revision 1641)
+++ code/branches/gui/src/core/input/SimpleInputState.cc	(revision 1642)
@@ -38,7 +38,10 @@
 #include "core/Debug.h"
 #include "core/Executor.h"
+#include "core/CoreIncludes.h"
 
 namespace orxonox
 {
+    CreateFactory(SimpleInputState);
+
     using namespace InputDevice;
 
@@ -48,4 +51,5 @@
         , joyStickHandlerAll_(0)
     {
+        RegisterObject(SimpleInputState);
     }
 
Index: code/branches/gui/src/core/input/SimpleInputState.h
===================================================================
--- code/branches/gui/src/core/input/SimpleInputState.h	(revision 1641)
+++ code/branches/gui/src/core/input/SimpleInputState.h	(revision 1642)
@@ -43,8 +43,6 @@
 namespace orxonox
 {
-
     class _CoreExport SimpleInputState : public InputState
     {
-
     public:
         SimpleInputState();
