Index: code/trunk/src/libraries/core/input/KeyBinderManager.h
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinderManager.h	(revision 5929)
+++ code/trunk/src/libraries/core/input/KeyBinderManager.h	(revision 6417)
@@ -34,9 +34,11 @@
 #include <map>
 #include <string>
+#include <boost/shared_ptr.hpp>
+
 #include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
 
-namespace orxonox
-{
+namespace orxonox //tolua_export
+{ //tolua_export
     /**
     @brief
@@ -46,11 +48,12 @@
         maps to the currently active KeyBinder. You can set that with setCurrent().
         There is also a default one, retrieved with getDefault(). The idea is that
-        mostly the default KeyBinder is active except for special situtations (mini-game for inst).
+        mostly the default KeyBinder is active except for special situations (mini-game for inst).
     @remarks
         You are not forced to use the KeyBinder imposed by getCurrent(). But be aware that "keybind"
         will not work as expected!
     */
-    class _CoreExport KeyBinderManager : public Singleton<KeyBinderManager>, public OrxonoxClass
-    {
+    class _CoreExport KeyBinderManager //tolua_export
+        : public Singleton<KeyBinderManager>, public OrxonoxClass
+    { //tolua_export
         friend class Singleton<KeyBinderManager>;
     public:
@@ -59,7 +62,7 @@
         void setConfigValues();
 
+        static KeyBinderManager& getInstance() { return Singleton<KeyBinderManager>::getInstance(); } //tolua_export
         //! Returns the currently selected KeyBinder
-        KeyBinder*    getCurrent()
-            { return this->currentBinder_; }
+        KeyBinder* getCurrent() { return this->currentBinder_; } //tolua_export
         //! Like getCurrent(), but returns it as InputHandler* (so you don't have to include KeyBinder.h)
         InputHandler* getCurrentAsHandler();
@@ -68,5 +71,5 @@
 
         //! Returns the default KeyBinder
-        KeyBinder*    getDefault()
+        KeyBinder* getDefault()
             { return binders_[this->defaultFilename_]; }
         //! Returns the default KeyBinder as InputHandler* (so you don't have to include KeyBinder.h)
@@ -80,24 +83,26 @@
 
         //! Returns a pointer to a KeyBinder (creates it if not yet loaded)
-        KeyBinder*    get(const std::string& name);
+        KeyBinder* get(const std::string& name);
         //! Like get() but return value is of type InputHandler* (so you don't have to include KeyBinder.h)
         InputHandler* getAsHandler(const std::string& name);
 
         //! Loads a KeyBinder by creating it (no different from get() except for the return value)
-        void load  (const std::string& filename);
+        void load(const std::string& filename);
         //! Destroys a KeyBinder completely (does nothing if not yet loaded)
         void unload(const std::string& filename);
 
         //! Bind 'command' to any key pressed after this call (use with care!)
-        inline void keybind(const std::string& command)
-            { this->keybindInternal(command, false); }
+        inline void keybind(const std::string& command) { this->keybindInternal(command, false); } //tolua_export
         //! Bind 'command' to any key pressed after this call (use with care!), but temporarily (no file save)
         inline void tkeybind(const std::string& command)
             { this->keybindInternal(command, true); }
+        void unbind(const std::string& binding); //tolua_export
+        void tunbind(const std::string& binding);
+        inline void registerKeybindCallback(Functor* function) { this->callbackFunction_.reset(function); } // tolua_export
 
     private:
         KeyBinderManager(const KeyBinderManager&);
         void keybindInternal(const std::string& command, bool bTemporary);
-        void callback(const std::string& keyName);
+        void keybindKeyPressed(const std::string& keyName);
         void defaultFilenameChanged();
 
@@ -109,5 +114,5 @@
 
         // keybind command related
-        Functor* callbackFunction_;                  //! Function to be called when key was pressed after "keybind" command
+        shared_ptr<Functor> callbackFunction_;       //! Function to be called when key was pressed after "keybind" command
         bool bBinding_;                              //! Tells whether a key binding process is active
         bool bTemporary_;                            //! Stores tkeybind/keybind value
@@ -115,6 +120,6 @@
 
         static KeyBinderManager* singletonPtr_s;
-    };
-}
+    }; //tolua_export
+} //tolua_export
 
 #endif /* _KeyBinderManager_H__ */
