Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/CMakeLists.txt
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/CMakeLists.txt	(revision 12252)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/CMakeLists.txt	(revision 12253)
@@ -1,4 +1,5 @@
 SET_SOURCE_FILES(MOUSEAPI_SRC_FILES
   mouseapi.cc
+  mouseapiexample.cc
 )
 
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc	(revision 12252)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc	(revision 12253)
@@ -3,18 +3,35 @@
 namespace orxonox{
 
-MouseAPI::MouseAPI(Camera& camera)
+MouseAPI::MouseAPI()
 {
-    cam = camera.getOgreCamera();
-    state = InputManager::getInstance().createInputState("MouseAPI");
-    state->setMouseExclusive(false);//does this work
-    state->setMouseHandler(this);
-    InputManager::getInstance().enterState("MouseAPI");
 
 }
 
-MouseAPI::~MouseAPI(){
-    InputManager::getInstance().leaveState("MouseAPI");
-    state->setMouseHandler(nullptr);
-    InputManager::getInstance().destroyState("MouseAPI");
+void MouseAPI::activate()
+{
+     if(InputManager::exists())
+     {
+        cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();
+        state = InputManager::getInstance().createInputState("MouseAPI");
+        state->setMouseExclusive(false);//does this work
+        state->setMouseHandler(this);
+        InputManager::getInstance().enterState("MouseAPI");
+    }
+
+}
+
+void MouseAPI::deactivate()
+{
+    if(InputManager::exists())
+    {
+        InputManager::getInstance().leaveState("MouseAPI");
+        state->setMouseHandler(nullptr);
+        InputManager::getInstance().destroyState("MouseAPI");
+    }
+}
+
+MouseAPI::~MouseAPI()
+{
+
 }
 
@@ -27,5 +44,5 @@
         for(auto wantedButton:event.buttons){
             if(wantedButton == button && ray.intersects(Ogre::Sphere(event.position,event.radius)).first)
-                (*(event.onClickedFunction))(button);
+                event.onClickedFunction(button);
         }
     }
@@ -47,5 +64,5 @@
 }
 
-void MouseAPI::addClickableObject(const Vector3& position,float radius,const std::list<MouseButtonCode::ByEnum>& buttons,void (*onClickedFunction)(MouseButtonCode::ByEnum button))
+void MouseAPI::addClickableObject(const Vector3& position, float radius, const std::list<MouseButtonCode::ByEnum>& buttons, std::function<void(MouseButtonCode::ByEnum)> onClickedFunction)
 {
     clickEvents.insert(clickEvents.begin(),{position,radius,buttons,onClickedFunction});
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.h
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.h	(revision 12252)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.h	(revision 12253)
@@ -14,4 +14,6 @@
 #include <OgreCamera.h>
 #include <OgreViewport.h>
+#include "CameraManager.h"
+#include <functional>
 
 namespace orxonox
@@ -28,6 +30,6 @@
         float radius;
         std::list<MouseButtonCode::ByEnum> buttons;
-        void (*onClickedFunction)(MouseButtonCode::ByEnum button);
-        clickableElement(const Vector3& position,float radius,const std::list<MouseButtonCode::ByEnum>& buttons,void (*onClickedFunction)(MouseButtonCode::ByEnum button)):position(position),
+        std::function<void(MouseButtonCode::ByEnum button)> onClickedFunction;
+        clickableElement(const Vector3& position,float radius,const std::list<MouseButtonCode::ByEnum>& buttons,std::function<void(MouseButtonCode::ByEnum button)> onClickedFunction):position(position),
             radius(radius), buttons(buttons), onClickedFunction(onClickedFunction){}
     };
@@ -55,5 +57,5 @@
 public:
 
-    MouseAPI(Camera& cam);
+    MouseAPI();
     ~MouseAPI();
     virtual void buttonPressed (MouseButtonCode::ByEnum button) override;
@@ -63,9 +65,12 @@
     virtual void mouseScrolled (int abs, int rel) override;
 
-    void addClickableObject(const Vector3& position,float radius,const std::list<MouseButtonCode::ByEnum>& buttons,void (*onClickedFunction)(MouseButtonCode::ByEnum button));
+    void addClickableObject(const Vector3& position,float radius,const std::list<MouseButtonCode::ByEnum>& buttons,std::function<void(MouseButtonCode::ByEnum button)>  onClickedFunction);
     void addScrollElement(const Vector3& position,float radius,void (*onScrolledFunction)(int abs,int rel,const IntVector2&  mousePos));
     void addScrollElement(void (*onScrolledFunction)(int abs,int rel,const IntVector2&  mousePos));
 
     void changeCamera(Camera& camera);
+
+    void activate();
+    void deactivate();
 };
 }
