Index: /code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua
===================================================================
--- /code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua	(revision 6213)
+++ /code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua	(revision 6214)
@@ -55,5 +55,9 @@
 function showGUI(filename, hidePrevious, bCursorVisible)
     if bCursorVisible == nil then
-        bCursorVisible = true
+        if nrOfActiveSheets > 0 then
+            bCursorVisible = cursorVisibility[nrOfActiveSheets]
+        else
+            bCursorVisible = true
+        end
     end
 
@@ -170,5 +174,7 @@
 
 function keyESC()
-    if nrOfActiveSheets > 0 then
+    if nrOfActiveSheets == 1 and activeSheets[1] == "MainMenu" then
+        orxonox.CommandExecutor:execute("exit")
+    elseif nrOfActiveSheets > 0 then
         orxonox.CommandExecutor:execute("hideGUI "..activeSheets[nrOfActiveSheets])
     else
Index: /code/branches/presentation2/src/libraries/core/CMakeLists.txt
===================================================================
--- /code/branches/presentation2/src/libraries/core/CMakeLists.txt	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/CMakeLists.txt	(revision 6214)
@@ -91,4 +91,6 @@
     LuaState.h
     input/InputManager.h
+    input/KeyBinder.h
+    input/KeyBinderManager.h
   DEFINE_SYMBOL
     "CORE_SHARED_BUILD"
Index: /code/branches/presentation2/src/libraries/core/GUIManager.cc
===================================================================
--- /code/branches/presentation2/src/libraries/core/GUIManager.cc	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/GUIManager.cc	(revision 6214)
@@ -62,4 +62,8 @@
 namespace orxonox
 {
+    static void key_esc()
+        { GUIManager::getInstance().keyESC(); }
+    SetConsoleCommandShortcutExternAlias(key_esc, "keyESC");
+    
     class CEGUILogger : public CEGUI::DefaultLogger
     {
Index: /code/branches/presentation2/src/libraries/core/Game.cc
===================================================================
--- /code/branches/presentation2/src/libraries/core/Game.cc	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/Game.cc	(revision 6214)
@@ -58,7 +58,4 @@
         { Game::getInstance().stop(); }
     SetConsoleCommandShortcutExternAlias(stop_game, "exit");
-    static void key_esc()
-        { Game::getInstance().keyESC(); }
-    SetConsoleCommandShortcutExternAlias(key_esc, "keyESC");
     static void printFPS()
         { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }
@@ -331,12 +328,4 @@
     }
 
-    void Game::keyESC()
-    {
-        if( this->getState("mainMenu") && this->getState("mainMenu")->getActivity().active==true )
-            this->stop();
-        else
-            GUIManager::getInstance().keyESC();
-    }
-
     void Game::stop()
     {
Index: /code/branches/presentation2/src/libraries/core/Game.h
===================================================================
--- /code/branches/presentation2/src/libraries/core/Game.h	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/Game.h	(revision 6214)
@@ -100,5 +100,4 @@
         void run();
         void stop();
-        void keyESC();
 
         static Game& getInstance(){ return Singleton<Game>::getInstance(); } // tolua_export
Index: /code/branches/presentation2/src/libraries/core/IOConsole.cc
===================================================================
--- /code/branches/presentation2/src/libraries/core/IOConsole.cc	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/IOConsole.cc	(revision 6214)
@@ -260,4 +260,5 @@
 
         // Process output written to std::cout
+        std::cout.flush();
         if (!this->origCout_.str().empty())
         {
Index: /code/branches/presentation2/src/libraries/core/input/KeyBinder.cc
===================================================================
--- /code/branches/presentation2/src/libraries/core/input/KeyBinder.cc	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/input/KeyBinder.cc	(revision 6214)
@@ -254,5 +254,8 @@
         // Parse bindings and create the ConfigValueContainers if necessary
         for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
+        {
             it->second->readConfigValue(this->configFile_);
+            this->allCommands_[it->second->bindingString_] = it->second->groupName_ + " " + it->second->name_;
+        }
 
         COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
@@ -269,4 +272,5 @@
                 it->second->configContainer_->set(binding);
             it->second->configContainer_->getValue(&(it->second->bindingString_), it->second);
+            this->allCommands_[it->second->bindingString_] = it->second->groupName_ + " " + it->second->name_;
             return true;
         }
@@ -276,4 +280,23 @@
             return false;
         }
+    }
+    
+    /**
+    @brief
+        Return the key name for a specific command
+    */
+    std::string KeyBinder::getBinding(std::string commandName)
+    {
+        COUT(0)<< commandName << endl;
+        if( this->allCommands_.find(commandName) != this->allCommands_.end())
+        {
+            std::string keyname = this->allCommands_[commandName];
+//             while(keyname.find(".")!=keyname.npos)
+//                 keyname.replace(1, keyname.find("."), " ");
+            COUT(0) << keyname << endl;
+            return keyname;
+        }
+        else
+            return "";
     }
 
Index: /code/branches/presentation2/src/libraries/core/input/KeyBinder.h
===================================================================
--- /code/branches/presentation2/src/libraries/core/input/KeyBinder.h	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/input/KeyBinder.h	(revision 6214)
@@ -43,6 +43,8 @@
 #include "JoyStickQuantityListener.h"
 
+// tolua_begin
 namespace orxonox
 {
+    // tolua_end
     /**
     @brief
@@ -54,6 +56,7 @@
         KeyBinders. If you need to load other bindings, just create a new one.
     */
-    class _CoreExport KeyBinder : public InputHandler, public JoyStickQuantityListener
-    {
+    class _CoreExport KeyBinder // tolua_export
+        : public InputHandler, public JoyStickQuantityListener
+    { // tolua_export
     public:
         KeyBinder (const std::string& filename);
@@ -62,4 +65,5 @@
         void clearBindings();
         bool setBinding(const std::string& binding, const std::string& name, bool bTemporary = false);
+        std::string getBinding(std::string commandName); //tolua_export
         const std::string& getBindingsFilename()
             { return this->filename_; }
@@ -130,4 +134,6 @@
         //! Pointer list with all half axes
         std::vector<HalfAxis*> allHalfAxes_;
+        //! Maps input commands to all Button names, including half axes
+        std::map<std::string, std::string> allCommands_;
 
         /**
@@ -174,5 +180,5 @@
         // Use some value at about 1000. This can be configured with mouseSensitivity_ anyway.
         static const int mouseClippingSize_ = 1024;
-    };
+    };// tolua_export
 
 
@@ -219,5 +225,5 @@
             mouseAxes_[i].relVal_ = 0.0f;
     }
-}
+}// tolua_export
 
 #endif /* _KeyBinder_H__ */
Index: /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h
===================================================================
--- /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h	(revision 6213)
+++ /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h	(revision 6214)
@@ -37,6 +37,6 @@
 #include "core/OrxonoxClass.h"
 
-namespace orxonox
-{
+namespace orxonox //tolua_export
+{ //tolua_export
     /**
     @brief
@@ -51,6 +51,7 @@
         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 +60,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();
@@ -115,6 +116,6 @@
 
         static KeyBinderManager* singletonPtr_s;
-    };
-}
+    }; //tolua_export
+} //tolua_export
 
 #endif /* _KeyBinderManager_H__ */
