Index: code/branches/tutorial/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/tutorial/src/libraries/core/CMakeLists.txt	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/CMakeLists.txt	(revision 8051)
@@ -80,4 +80,5 @@
     Game.h
     GameMode.h
+    GraphicsManager.h
     GUIManager.h
     Loader.h
Index: code/branches/tutorial/src/libraries/core/Core.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/Core.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/Core.cc	(revision 8051)
@@ -208,6 +208,10 @@
 #ifdef ORXONOX_RELEASE
         const unsigned int defaultLevelLogFile = 3;
+        SetConfigValue(bDevMode_, false)
+            .description("Developer mode. If not set, hides some things from the user to not confuse him.");
 #else
         const unsigned int defaultLevelLogFile = 4;
+        SetConfigValue(bDevMode_, true)
+            .description("Developer mode. If not set, hides some things from the user to not confuse him.");
 #endif
         SetConfigValueExternal(softDebugLevelLogFile_, "OutputHandler", "softDebugLevelLogFile", defaultLevelLogFile)
Index: code/branches/tutorial/src/libraries/core/Core.h
===================================================================
--- code/branches/tutorial/src/libraries/core/Core.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/Core.h	(revision 8051)
@@ -91,4 +91,7 @@
                 { return this->ogreConfigTimestamp_; }
 
+            inline bool inDevMode(void) const
+                { return this->bDevMode_; }
+
         private:
             Core(const Core&); //!< Don't use (undefined symbol)
@@ -130,4 +133,5 @@
             long long                     lastLevelTimestamp_;         ///< Timestamp when the last level was started
             long long                     ogreConfigTimestamp_;        ///< Timestamp wehen the ogre config level was modified
+            bool                          bDevMode_;                   //!< Developers bit. If set to false, some options are not available as to not confuse the normal user.
 
             static Core*                  singletonPtr_s;
Index: code/branches/tutorial/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/GUIManager.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/GUIManager.cc	(revision 8051)
@@ -103,6 +103,17 @@
     /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen";
 
+    static const std::string __CC_navigateGUI_name = "navigateGUI";
+
     SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false);
     SetConsoleCommand("hideGUI", &GUIManager::hideGUI);
+    SetConsoleCommand("toggleGUI", &GUIManager::toggleGUI).defaultValue(1, false).defaultValue(2, false);
+    SetConsoleCommand(__CC_navigateGUI_name, &GUIManager::navigateGUI).deactivate();
+
+    //! Strings that specify modes for the GUI navigation.
+    /*static*/ const std::string GUIManager::NAVIGATE_UP = "up";
+    /*static*/ const std::string GUIManager::NAVIGATE_DOWN = "down";
+    /*static*/ const std::string GUIManager::NAVIGATE_LEFT = "left";
+    /*static*/ const std::string GUIManager::NAVIGATE_RIGHT = "right";
+    /*static*/ const std::string GUIManager::NAVIGATE_ENTER = "enter";
 
     /**
@@ -282,4 +293,27 @@
     {
         GUIManager::getInstance().executeCode("hideMenuSheet(\"" + name + "\")");
+    }
+
+    /**
+    @brief
+        Toggles specified GUI.
+        If the GUI with the input name is already shown and on the top, it is hidden, else it is shown.
+    */
+    /*static*/ void GUIManager::toggleGUI(const std::string& name, bool bHidePrevious, bool bNoInput)
+    {
+        GUIManager::getInstance().executeCode("getGUIFirstActive(\"" + name + "\", " + multi_cast<std::string>(bHidePrevious) + ", " + multi_cast<std::string>(bNoInput) + ")");
+    }
+
+    /**
+    @brief
+        Helper method to toggle a specified GUI.
+        Is called by lua.
+    */
+    void GUIManager::toggleGUIHelper(const std::string& name, bool bHidePrevious, bool bNoInput, bool show)
+    {
+        if(show)
+            GUIManager::showGUI(name, bHidePrevious, bNoInput);
+        else
+            GUIManager::hideGUI(name);
     }
 
@@ -340,4 +374,41 @@
             this->rootWindow_->setProperty("Alpha", "1.0");
         this->rootWindow_->setProperty("Image", image);
+    }
+
+    /**
+    @brief
+        Method to navigate the GUI, by specifying the mode of navigation.
+    @param mode
+        The mode of navigation, at this point can be either 'up', 'down', 'left', 'right' or 'enter'.
+    */
+    /*static*/ void GUIManager::navigateGUI(const std::string& mode)
+    {
+        if(mode == NAVIGATE_UP)
+            GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_UP + "\")");
+        else if(mode == NAVIGATE_DOWN)
+            GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_DOWN + "\")");
+        else if(mode == NAVIGATE_LEFT)
+            GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_LEFT + "\")");
+        else if(mode == NAVIGATE_RIGHT)
+            GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_RIGHT + "\")");
+        else if(mode == NAVIGATE_ENTER)
+            GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_ENTER + "\")");
+    }
+
+    /**
+    @brief
+        Is called by lua to change whether there are any GUIs active at the moment.
+    @param active
+        Whether GUIs are active.
+    */
+    void GUIManager::guisActiveChanged(bool active)
+    {
+        if(this->GUIsActive_ == active)
+            return;
+        this->GUIsActive_ = active;
+        if(this->GUIsActive_)
+            ModifyConsoleCommand(__CC_navigateGUI_name).activate();
+        else
+            ModifyConsoleCommand(__CC_navigateGUI_name).deactivate();
     }
 
Index: code/branches/tutorial/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/tutorial/src/libraries/core/GUIManager.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/GUIManager.h	(revision 8051)
@@ -49,4 +49,5 @@
 #include "util/Singleton.h"
 #include "input/InputHandler.h"
+#include "Core.h"
 #include "OrxonoxClass.h"
 #include "WindowEventListener.h"
@@ -88,7 +89,18 @@
         void showGUIExtra(const std::string& name, const std::string& ptr, bool bHidePrevious = false, bool bNoInput = false);
         static void hideGUI(const std::string& name);
+        static void toggleGUI(const std::string& name, bool bHidePrevious = false, bool bNoInput = false);
+        void toggleGUIHelper(const std::string& name, bool bHidePrevious, bool bNoInput, bool show); // tolua_export
         void keyESC();
         void setBackgroundImage(const std::string& imageSet, const std::string imageName); // tolua_export
         void setBackgroundImage(const std::string& image);
+
+        static void navigateGUI(const std::string& mode);
+        void guisActiveChanged(bool active); // tolua_export
+
+        /**
+        @brief Helper method to get the developer's mode without having to export Core.h.
+        @see Core::inDevMode
+        */
+        static bool inDevMode(void) { return Core::getInstance().inDevMode(); } // tolua_export
 
         //! Creates a new InputState to be used with a GUI Sheet
@@ -122,4 +134,12 @@
         template <typename FunctionType>
         bool protectedCall(FunctionType function);
+
+        static const std::string NAVIGATE_UP;
+        static const std::string NAVIGATE_DOWN;
+        static const std::string NAVIGATE_LEFT;
+        static const std::string NAVIGATE_RIGHT;
+        static const std::string NAVIGATE_ENTER;
+
+        bool GUIsActive_; //!< Whether there are any GUIs active at a given moment.
 
         // keyHandler functions
Index: code/branches/tutorial/src/libraries/core/Game.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/Game.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/Game.cc	(revision 8051)
@@ -61,8 +61,8 @@
     static void printFPS()
         { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }
-    SetConsoleCommand("printFPS", &printFPS);
+    SetConsoleCommand("Stats", "printFPS", &printFPS);
     static void printTickTime()
         { COUT(0) << Game::getInstance().getAvgTickTime() << std::endl; }
-    SetConsoleCommand("printTickTime", &printTickTime);
+    SetConsoleCommand("Stats", "printTickTime", &printTickTime);
 
     std::map<std::string, GameStateInfo> Game::gameStateDeclarations_s;
Index: code/branches/tutorial/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/GraphicsManager.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/GraphicsManager.cc	(revision 8051)
@@ -480,16 +480,55 @@
     }
 
+    unsigned int GraphicsManager::getWindowWidth() const
+    {
+        return this->renderWindow_->getWidth();
+    }
+
+    unsigned int GraphicsManager::getWindowHeight() const
+    {
+        return this->renderWindow_->getHeight();
+    }
+
     bool GraphicsManager::hasVSyncEnabled() const
     {
         Ogre::ConfigOptionMap& options = ogreRoot_->getRenderSystem()->getConfigOptions();
-        if (options.find("VSync") != options.end())
-            return (options["VSync"].currentValue == "Yes");
+        Ogre::ConfigOptionMap::iterator it = options.find("VSync");
+        if (it != options.end())
+            return (it->second.currentValue == "Yes");
         else
             return false;
     }
 
+    std::string GraphicsManager::getFSAAMode() const
+    {
+        Ogre::ConfigOptionMap& options = ogreRoot_->getRenderSystem()->getConfigOptions();
+        Ogre::ConfigOptionMap::iterator it = options.find("FSAA");
+        if (it != options.end())
+            return it->second.currentValue;
+        else
+            return "";
+    }
+
     std::string GraphicsManager::setScreenResolution(unsigned int width, unsigned int height, bool fullscreen)
     {
-        this->ogreRoot_->getRenderSystem()->setConfigOption("Video Mode", multi_cast<std::string>(width) + " x " + multi_cast<std::string>(height) + " @ " + multi_cast<std::string>(this->getRenderWindow()->getColourDepth()) + "-bit colour");
+        // workaround to detect if the colour depth should be written to the config file
+        bool bWriteColourDepth = false;
+        Ogre::ConfigOptionMap& options = ogreRoot_->getRenderSystem()->getConfigOptions();
+        Ogre::ConfigOptionMap::iterator it = options.find("Video Mode");
+        if (it != options.end())
+            bWriteColourDepth = (it->second.currentValue.find('@') != std::string::npos);
+
+        if (bWriteColourDepth)
+        {
+            this->ogreRoot_->getRenderSystem()->setConfigOption("Video Mode", multi_cast<std::string>(width)
+                                                                    + " x " + multi_cast<std::string>(height)
+                                                                    + " @ " + multi_cast<std::string>(this->getRenderWindow()->getColourDepth()) + "-bit colour");
+        }
+        else
+        {
+            this->ogreRoot_->getRenderSystem()->setConfigOption("Video Mode", multi_cast<std::string>(width)
+                                                                    + " x " + multi_cast<std::string>(height));
+        }
+
         this->ogreRoot_->getRenderSystem()->setConfigOption("Full Screen", fullscreen ? "Yes" : "No");
 
Index: code/branches/tutorial/src/libraries/core/GraphicsManager.h
===================================================================
--- code/branches/tutorial/src/libraries/core/GraphicsManager.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/GraphicsManager.h	(revision 8051)
@@ -54,4 +54,5 @@
 #include "OrxonoxClass.h"
 
+// tolua_begin
 namespace orxonox
 {
@@ -60,6 +61,8 @@
         Graphics engine manager class
     */
-    class _CoreExport GraphicsManager : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener
-    {
+    class _CoreExport GraphicsManager
+// tolua_end
+        : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener
+    { // tolua_export
         friend class Singleton<GraphicsManager>;
     public:
@@ -74,6 +77,15 @@
         Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
         size_t getRenderWindowHandle();
+
+// tolua_begin
+        static GraphicsManager& getInstance() { return Singleton<GraphicsManager>::getInstance(); } // tolua_export
+
         bool isFullScreen() const;
+        unsigned int getWindowWidth() const;
+        unsigned int getWindowHeight() const;
+
         bool hasVSyncEnabled() const;
+        std::string getFSAAMode() const;
+// tolua_end
 
         void upgradeToGraphics();
@@ -127,6 +139,8 @@
 
         static GraphicsManager* singletonPtr_s;        //!< Pointer to the Singleton
+// tolua_begin
     };
 }
+// tolua_end
 
 #endif /* _GraphicsManager_H__ */
Index: code/branches/tutorial/src/libraries/core/command/CommandEvaluation.h
===================================================================
--- code/branches/tutorial/src/libraries/core/command/CommandEvaluation.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/command/CommandEvaluation.h	(revision 8051)
@@ -70,9 +70,9 @@
 
         @remarks execCommand_ and hintCommand_ can be different in this case: There are multiple
-        commands avaliable, let's say "tcl", "tclexecute", and "tclquery". The user enters
-        "tcl", which is already a valid command. Now execCommand_ points to the "tcl"-command,
-        but hintCommand_ still points to the autocompletion command of CommandExecutor, because
-        the auto-completion list must still return the three possible commands, "tcl tclexecute tclquery"
-        because the user may want to execute "tclquery" and needs auto-completion.
+        commands avaliable, let's say "tcl" and "TclThreadManager". The user enters "tcl", which
+        is already a valid command. Now execCommand_ points to the "tcl"-command, but hintCommand_
+        still points to the autocompletion command of CommandExecutor, because the auto-completion
+        list must still return the two possible commands, "tcl TclThreadManager" because the user
+        may want to write "TclThreadManager ..." and needs auto-completion.
 
         @see See @ref CommandExecutorExample "this description" for an example.
Index: code/branches/tutorial/src/libraries/core/command/ConsoleCommandCompilation.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/command/ConsoleCommandCompilation.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/command/ConsoleCommandCompilation.cc	(revision 8051)
@@ -46,11 +46,11 @@
 namespace orxonox
 {
-    SetConsoleCommand("source", source).argumentCompleter(0, autocompletion::files());
+//    SetConsoleCommand("source", source).argumentCompleter(0, autocompletion::files());  // disabled because we use the implementation in Tcl
     SetConsoleCommand("echo", echo);
-    SetConsoleCommand("puts", puts);
-
-    SetConsoleCommand("read", read).argumentCompleter(0, autocompletion::files());
-    SetConsoleCommand("append", append).argumentCompleter(0, autocompletion::files());
-    SetConsoleCommand("write", write).argumentCompleter(0, autocompletion::files());
+//    SetConsoleCommand("puts", puts);                                                    // disabled because we use the implementation in Tcl
+
+//    SetConsoleCommand("read", read).argumentCompleter(0, autocompletion::files());      // disabled because we use the implementation in Tcl
+//    SetConsoleCommand("append", append).argumentCompleter(0, autocompletion::files());  // disabled because we use the implementation in Tcl
+//    SetConsoleCommand("write", write).argumentCompleter(0, autocompletion::files());    // disabled because we use the implementation in Tcl
 
     SetConsoleCommand("calculate", calculate);
Index: code/branches/tutorial/src/libraries/core/command/Shell.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/command/Shell.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/command/Shell.cc	(revision 8051)
@@ -46,8 +46,8 @@
 {
     SetConsoleCommand("log",     OutputHandler::log    );
-    SetConsoleCommand("error",   OutputHandler::error  );
-    SetConsoleCommand("warning", OutputHandler::warning);
-    SetConsoleCommand("info",    OutputHandler::info   );
-    SetConsoleCommand("debug",   OutputHandler::debug  );
+    SetConsoleCommand("error",   OutputHandler::error  ).hide();
+    SetConsoleCommand("warning", OutputHandler::warning).hide();
+    SetConsoleCommand("info",    OutputHandler::info   ).hide();
+    SetConsoleCommand("debug",   OutputHandler::debug  ).hide();
 
     unsigned int Shell::cacheSize_s;
Index: code/branches/tutorial/src/libraries/core/command/TclBind.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/command/TclBind.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/command/TclBind.cc	(revision 8051)
@@ -45,5 +45,5 @@
 {
     SetConsoleCommand("tcl", &TclBind::tcl);
-    SetConsoleCommand("bgerror", &TclBind::bgerror);
+    SetConsoleCommand("bgerror", &TclBind::bgerror).hide();
 
     TclBind* TclBind::singletonPtr_s = 0;
@@ -91,13 +91,14 @@
 
             this->interpreter_->def("::orxonox::query", TclBind::tcl_query, Tcl::variadic());
+            this->interpreter_->def("::orxonox::execute", TclBind::tcl_execute, Tcl::variadic());
             this->interpreter_->def("::orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic());
-            this->interpreter_->def("execute", TclBind::tcl_execute, Tcl::variadic());
             this->interpreter_->def("::orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());
 
             try
             {
-                this->interpreter_->eval("proc query        {args}    { ::orxonox::query $args }");
+                this->interpreter_->def("query", TclBind::tcl_query, Tcl::variadic());
+                this->interpreter_->def("execute", TclBind::tcl_execute, Tcl::variadic());
                 this->interpreter_->eval("proc crossquery   {id args} { ::orxonox::crossquery 0 $id $args }");
-                this->interpreter_->eval("proc crossexecute {id args} { ::orxonox::crossquery 0 $id $args }");
+                this->interpreter_->eval("proc crossexecute {id args} { ::orxonox::crossexecute 0 $id $args }");
                 this->interpreter_->eval("proc running      {}        { return 1 }");
                 this->interpreter_->eval("set id 0");
@@ -154,10 +155,33 @@
     {
         COUT(4) << "Tcl_query: " << args.get() << std::endl;
-
+        return TclBind::tcl_helper(args, true);
+    }
+
+    /**
+        @brief Callback: Used to send an Orxonox-command from Tcl to the CommandExecutor.
+    */
+    void TclBind::tcl_execute(Tcl::object const &args)
+    {
+        COUT(4) << "Tcl_execute: " << args.get() << std::endl;
+        TclBind::tcl_helper(args, false);
+    }
+
+    /**
+        @brief Helper function, used by tcl_query() and tcl_execute().
+    */
+    std::string TclBind::tcl_helper(Tcl::object const &args, bool bQuery)
+    {
         const std::string& command = stripEnclosingBraces(args.get());
 
         int error;
+        std::string result;
+
         CommandEvaluation evaluation = CommandExecutor::evaluate(command);
-        const std::string& result = evaluation.query(&error);
+
+        if (bQuery)
+            result = evaluation.query(&error).getString();
+        else
+            error = evaluation.execute();
+
         switch (error)
         {
@@ -175,18 +199,4 @@
 
     /**
-        @brief Callback: Used to send an Orxonox-command from Tcl to the CommandExecutor.
-    */
-    void TclBind::tcl_execute(Tcl::object const &args)
-    {
-        COUT(4) << "Tcl_execute: " << args.get() << std::endl;
-        const std::string& command = stripEnclosingBraces(args.get());
-
-        if (CommandExecutor::execute(command, false))
-        {
-            COUT(1) << "Error: Can't execute command \"" << command << "\"!" << std::endl;
-        }
-    }
-
-    /**
         @brief Console command, executes Tcl code. Can be used to bind Tcl-commands to a key, because native
         Tcl-commands can not be evaluated and are thus not supported by the key-binder.
@@ -198,13 +208,8 @@
             try
             {
-                const std::string& output = TclBind::getInstance().interpreter_->eval("uplevel #0 " + tclcode);
-                if (!output.empty())
-                {
-                    COUT(0) << "tcl> " << output << std::endl;
-                }
-                return output;
+                return TclBind::getInstance().interpreter_->eval("uplevel #0 " + tclcode);
             }
             catch (Tcl::tcl_error const &e)
-            {   COUT(1) << "tcl> Error: " << e.what() << std::endl;   }
+            {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
         }
 
Index: code/branches/tutorial/src/libraries/core/command/TclBind.h
===================================================================
--- code/branches/tutorial/src/libraries/core/command/TclBind.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/command/TclBind.h	(revision 8051)
@@ -126,4 +126,6 @@
             TclBind(const TclBind& other);      ///< Copy-constructor, not implemented
 
+            static std::string tcl_helper(Tcl::object const &args, bool bQuery);
+
             Tcl::interpreter* interpreter_;     ///< The wrapped Tcl interpreter
             std::string tclDataPath_;           ///< The path to the directory that contains the Orxonox-specific Tcl-files
Index: code/branches/tutorial/src/libraries/core/command/TclThreadManager.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/command/TclThreadManager.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/command/TclThreadManager.cc	(revision 8051)
@@ -55,6 +55,4 @@
     const float TCLTHREADMANAGER_MAX_CPU_USAGE = 0.50f;
 
-    SetConsoleCommand("tclexecute", &TclThreadManager::execute).argumentCompleter(0, autocompletion::tclthreads());
-    SetConsoleCommand("tclquery",   &TclThreadManager::query  ).argumentCompleter(0, autocompletion::tclthreads());
     SetConsoleCommand("TclThreadManager", "create",  &TclThreadManager::create);
     SetConsoleCommand("TclThreadManager", "destroy", &TclThreadManager::destroy).argumentCompleter(0, autocompletion::tclthreads());
Index: code/branches/tutorial/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/input/InputManager.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/input/InputManager.cc	(revision 8051)
@@ -641,3 +641,19 @@
         state->destroy();
     }
+
+    bool InputManager::setMouseExclusive(const std::string& name, TriBool::Value value)
+    {
+        if (name == "empty")
+        {
+            COUT(2) << "InputManager: Changing the empty state is not allowed!" << std::endl;
+            return false;
+        }
+        std::map<std::string, InputState*>::iterator it = statesByName_.find(name);
+        if (it != statesByName_.end())
+        {
+            it->second->setMouseExclusive(value);
+            return true;
+        }
+        return false;
+    }
 }
Index: code/branches/tutorial/src/libraries/core/input/InputManager.h
===================================================================
--- code/branches/tutorial/src/libraries/core/input/InputManager.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/input/InputManager.h	(revision 8051)
@@ -163,4 +163,11 @@
         */
         bool destroyState(const std::string& name); // tolua_export
+        /**
+        @brief
+            Changes the mouse mode of an input state.
+        @return
+            True if the call was successful, fals if the name was not found
+        */
+        bool setMouseExclusive(const std::string& name, TriBool::Value value); // tolua_export
 
         //-------------------------------
Index: code/branches/tutorial/src/libraries/core/input/Keyboard.cc
===================================================================
--- code/branches/tutorial/src/libraries/core/input/Keyboard.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/input/Keyboard.cc	(revision 8051)
@@ -36,16 +36,26 @@
     {
         // update modifiers
-        if (arg.key == OIS::KC_RMENU    || arg.key == OIS::KC_LMENU)
-            modifiers_ |= KeyboardModifier::Alt;   // alt key
-        if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)
-            modifiers_ |= KeyboardModifier::Ctrl;  // ctrl key
-        if (arg.key == OIS::KC_RSHIFT   || arg.key == OIS::KC_LSHIFT)
-            modifiers_ |= KeyboardModifier::Shift; // shift key
+        switch (arg.key)
+        {
+            case OIS::KC_RMENU:
+            case OIS::KC_LMENU:
+                modifiers_ |= KeyboardModifier::Alt;   // alt key
+                break;
+            case OIS::KC_RCONTROL:
+            case OIS::KC_LCONTROL:
+                modifiers_ |= KeyboardModifier::Ctrl;  // ctrl key
+                break;
+            case OIS::KC_RSHIFT:
+            case OIS::KC_LSHIFT:
+                modifiers_ |= KeyboardModifier::Shift; // shift key
+                break;
+            case OIS::KC_TAB:
+                // Do not distribute the alt+tab event (messes with the operating system)
+                if ((modifiers_ & KeyboardModifier::Alt) != 0)
+                    return true;
+            default:;
+        }
 
-        // Do not distribute the alt+tab event (messes with the operating system)
-        if ((modifiers_ & KeyboardModifier::Alt) != 0 && arg.key == OIS::KC_TAB)
-            return true;
-
-        KeyEvent evt(arg);
+        KeyEvent evt(static_cast<KeyCode::ByEnum>(arg.key), Keyboard::getKeyText(arg), 0);
         super::buttonPressed(evt);
         return true;
@@ -56,14 +66,46 @@
     {
         // update modifiers
-        if (arg.key == OIS::KC_RMENU    || arg.key == OIS::KC_LMENU)
-            modifiers_ &= ~KeyboardModifier::Alt;   // alt key
-        if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)
-            modifiers_ &= ~KeyboardModifier::Ctrl;  // ctrl key
-        if (arg.key == OIS::KC_RSHIFT   || arg.key == OIS::KC_LSHIFT)
-            modifiers_ &= ~KeyboardModifier::Shift; // shift key
+        switch (arg.key)
+        {
+            case OIS::KC_RMENU:
+            case OIS::KC_LMENU:
+                modifiers_ &= ~KeyboardModifier::Alt;   // alt key
+                break;
+            case OIS::KC_RCONTROL:
+            case OIS::KC_LCONTROL:
+                modifiers_ &= ~KeyboardModifier::Ctrl;  // ctrl key
+                break;
+            case OIS::KC_RSHIFT:
+            case OIS::KC_LSHIFT:
+                modifiers_ &= ~KeyboardModifier::Shift; // shift key
+                break;
+            default:;
+        }
 
-        KeyEvent evt(arg);
+        KeyEvent evt(static_cast<KeyCode::ByEnum>(arg.key), Keyboard::getKeyText(arg), 0);
         super::buttonReleased(evt);
         return true;
     }
+
+    /// A map which returns the corresponding chars for some key codes
+    unsigned int Keyboard::getKeyText(const OIS::KeyEvent& arg)
+    {
+        switch (arg.key)
+        {
+            case OIS::KC_NUMPAD0:     return static_cast<unsigned int>('0');
+            case OIS::KC_NUMPAD1:     return static_cast<unsigned int>('1');
+            case OIS::KC_NUMPAD2:     return static_cast<unsigned int>('2');
+            case OIS::KC_NUMPAD3:     return static_cast<unsigned int>('3');
+            case OIS::KC_NUMPAD4:     return static_cast<unsigned int>('4');
+            case OIS::KC_NUMPAD5:     return static_cast<unsigned int>('5');
+            case OIS::KC_NUMPAD6:     return static_cast<unsigned int>('6');
+            case OIS::KC_NUMPAD7:     return static_cast<unsigned int>('7');
+            case OIS::KC_NUMPAD8:     return static_cast<unsigned int>('8');
+            case OIS::KC_NUMPAD9:     return static_cast<unsigned int>('9');
+            case OIS::KC_DECIMAL:     return static_cast<unsigned int>('.');
+            case OIS::KC_DIVIDE:      return static_cast<unsigned int>('/');
+            case OIS::KC_NUMPADENTER: return static_cast<unsigned int>('\n');
+            default:                  return arg.text;
+        }
+    }
 }
Index: code/branches/tutorial/src/libraries/core/input/Keyboard.h
===================================================================
--- code/branches/tutorial/src/libraries/core/input/Keyboard.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/core/input/Keyboard.h	(revision 8051)
@@ -83,4 +83,6 @@
         static std::string getClassNameImpl() { return "Keyboard"; }
 
+        static unsigned int getKeyText(const OIS::KeyEvent& arg);
+
         //! Bit mask representing keyboard modifiers
         int modifiers_;
Index: code/branches/tutorial/src/libraries/network/Host.cc
===================================================================
--- code/branches/tutorial/src/libraries/network/Host.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/network/Host.cc	(revision 8051)
@@ -38,8 +38,9 @@
 namespace orxonox {
 
+  static const std::string __CC_printRTT_group = "Stats";
   static const std::string __CC_printRTT_name = "printRTT";
 
   SetConsoleCommand("chat", &Host::Chat);
-  SetConsoleCommand(__CC_printRTT_name, &Host::printRTT);
+  SetConsoleCommand(__CC_printRTT_group, __CC_printRTT_name, &Host::printRTT);
 
   // Host*               Host::instance_=0;
@@ -55,5 +56,5 @@
   //   assert(instance_==0);
     instances_s.push_back(this);
-    ModifyConsoleCommand(__CC_printRTT_name).setObject(this);
+    ModifyConsoleCommand(__CC_printRTT_group, __CC_printRTT_name).setObject(this);
     this->bIsActive_ = false;
   }
@@ -67,5 +68,5 @@
     assert( std::find( instances_s.begin(), instances_s.end(), this )!=instances_s.end() );
     instances_s.erase(std::find( instances_s.begin(), instances_s.end(), this ));
-    ModifyConsoleCommand(__CC_printRTT_name).setObject(0);
+    ModifyConsoleCommand(__CC_printRTT_group, __CC_printRTT_name).setObject(0);
   }
 
Index: code/branches/tutorial/src/libraries/tools/Shader.h
===================================================================
--- code/branches/tutorial/src/libraries/tools/Shader.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/tools/Shader.h	(revision 8051)
@@ -38,4 +38,5 @@
 #include <OgreCompositorInstance.h>
 
+#include "util/MultiType.h"
 #include "util/OgreForwardRefs.h"
 #include "core/ViewportEventListener.h"
Index: code/branches/tutorial/src/libraries/tools/Timer.cc
===================================================================
--- code/branches/tutorial/src/libraries/tools/Timer.cc	(revision 8010)
+++ code/branches/tutorial/src/libraries/tools/Timer.cc	(revision 8051)
@@ -35,4 +35,6 @@
 
 #include <set>
+
+#include <boost/bimap.hpp>
 
 #include "util/Clock.h"
@@ -41,25 +43,54 @@
 #include "core/command/CommandExecutor.h"
 #include "core/command/Functor.h"
+#include "tools/interfaces/TimeFactorListener.h"
 
 namespace orxonox
 {
     SetConsoleCommand("delay", &delay).argumentCompleter(1, autocompletion::command());
+    SetConsoleCommand("delayreal", &delayreal).argumentCompleter(1, autocompletion::command());
+    SetConsoleCommand("killdelay", &killdelay);
     SetConsoleCommand("killdelays", &killdelays);
 
-    static std::set<Timer*> delaytimerset;
-
-    /**
-        @brief Console-command: Calls another console command after @a delay seconds.
+    static boost::bimap<unsigned int, Timer*> delaytimers;
+    static unsigned int delayHandleCounter = 0;
+
+    /**
+        @brief Console-command: Calls another console command after @a delay seconds (game time).
         @param delay The delay in seconds
         @param command The console command
-    */
-    void delay(float delay, const std::string& command)
-    {
-        Timer* delaytimer = new Timer();
-        delaytimerset.insert(delaytimer);
+        @return The handle of the delayed command, can be used as argument for killdelay()
+    */
+    unsigned int delay(float delay, const std::string& command)
+    {
+        return addDelayedCommand(new Timer(), delay, command);
+    }
+
+    /**
+        @brief Console-command: Calls another console command after @a delay seconds (real time)
+        @param delay The delay in seconds
+        @param command The console command
+        @return The handle of the delayed command, can be used as argument for killdelay()
+    */
+    unsigned int delayreal(float delay, const std::string& command)
+    {
+        return addDelayedCommand(new RealTimer(), delay, command);
+    }
+
+    /**
+        @brief Helper function, used by delay() and delayreal() to add a delayed command.
+        @param timer The timer which will execute the command
+        @param delay The delay in seconds
+        @param command The console command
+        @return The handle of the delayed command, can be used as argument for killdelay()
+    */
+    unsigned int addDelayedCommand(Timer* timer, float delay, const std::string& command)
+    {
+        delaytimers.insert(boost::bimap<unsigned int, Timer*>::value_type(++delayHandleCounter, timer));
 
         const ExecutorStaticPtr& delayexecutor = createExecutor(createFunctor(&executeDelayedCommand));
-        delayexecutor->setDefaultValues(delaytimer, command);
-        delaytimer->setTimer(delay, false, delayexecutor);
+        delayexecutor->setDefaultValues(timer, command);
+        timer->setTimer(delay, false, delayexecutor);
+
+        return delayHandleCounter;
     }
 
@@ -73,5 +104,5 @@
         CommandExecutor::execute(command);
         timer->destroy();
-        delaytimerset.erase(timer);
+        delaytimers.right.erase(timer);
     }
 
@@ -81,8 +112,21 @@
     void killdelays()
     {
-        for (std::set<Timer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
-            (*it)->destroy();
-
-        delaytimerset.clear();
+        for (boost::bimap<unsigned int, Timer*>::left_map::iterator it = delaytimers.left.begin(); it != delaytimers.left.end(); ++it)
+            it->second->destroy();
+
+        delaytimers.clear();
+    }
+
+    /**
+        @brief Console-command: Kills a delayed command with given handle.
+    */
+    void killdelay(unsigned int handle)
+    {
+        boost::bimap<unsigned int, Timer*>::left_map::iterator it = delaytimers.left.find(handle);
+        if (it != delaytimers.left.end())
+        {
+            it->second->destroy();
+            delaytimers.left.erase(it);
+        }
     }
 
@@ -93,5 +137,5 @@
     {
         this->init();
-        RegisterObject(Timer);
+        RegisterRootObject(Timer);
     }
 
@@ -106,5 +150,5 @@
     {
         this->init();
-        RegisterObject(Timer);
+        RegisterRootObject(Timer);
 
         this->setTimer(interval, bLoop, executor, bKillAfterCall);
@@ -123,4 +167,12 @@
 
         this->time_ = 0;
+    }
+
+    /**
+        @brief Returns the current time factor of the game.
+    */
+    float Timer::getTimeFactor()
+    {
+        return TimeFactorListener::getTimeFactor();
     }
 
@@ -168,3 +220,24 @@
         }
     }
+
+    ///////////////
+    // RealTimer //
+    ///////////////
+    /// @copydoc Timer::Timer
+    RealTimer::RealTimer()
+    {
+        RegisterObject(RealTimer);
+    }
+
+    /// @copydoc Timer::Timer(float, bool, const ExecutorPtr&, bool)
+    RealTimer::RealTimer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall) : Timer(interval, bLoop, executor, bKillAfterCall)
+    {
+        RegisterObject(RealTimer);
+    }
+
+    /// Returns always 1 because RealTimer doesn't depend on the game time.
+    float RealTimer::getTimeFactor()
+    {
+        return 1;
+    }
 }
Index: code/branches/tutorial/src/libraries/tools/Timer.h
===================================================================
--- code/branches/tutorial/src/libraries/tools/Timer.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/tools/Timer.h	(revision 8051)
@@ -81,18 +81,26 @@
 #include "core/OrxonoxClass.h"
 #include "core/command/Executor.h"
-#include "tools/interfaces/TimeFactorListener.h"
 
 namespace orxonox
 {
-    void delay(float delay, const std::string& command);
-    void killdelays();
+    unsigned int delay(float delay, const std::string& command);
+    unsigned int delayreal(float delay, const std::string& command);
+
+    unsigned int addDelayedCommand(Timer* timer, float delay, const std::string& command);
     void executeDelayedCommand(Timer* timer, const std::string& command);
 
+    void killdelay(unsigned int handle);
+    void killdelays();
+
     /**
-        @brief Timer is a helper class that executes a function after a given amount of time.
+        @brief Timer is a helper class that executes a function after a given amount of seconds in game-time.
 
         @see See @ref TimerExample "Timer.h" for an example.
+
+        The time interval of Timer depends on the game time, hence it stops if the game is paused or runs
+        slower/faster if the game-speed is modified. See RealTimer for a timer class which doesn't depend
+        on the game time.
     */
-    class _ToolsExport Timer : public TimeFactorListener
+    class _ToolsExport Timer : virtual public OrxonoxClass
     {
         public:
@@ -123,26 +131,26 @@
             void run();
 
-            /// Re-starts the Timer: The executor will be called after @a interval seconds.
+            /// Re-starts the timer: The executor will be called after @a interval seconds.
             inline void startTimer()
                 { this->bActive_ = true; this->time_ = this->interval_; }
-            /// Stops the Timer.
+            /// Stops the timer.
             inline void stopTimer()
                 { this->bActive_ = false; this->time_ = this->interval_; }
-            /// Pauses the Timer - it will continue with the actual state if you call unpauseTimer().
+            /// Pauses the timer - it will continue with the actual state if you call unpauseTimer().
             inline void pauseTimer()
                 { this->bActive_ = false; }
-            /// Unpauses the Timer - continues with the given state.
+            /// Unpauses the timer - continues with the given state.
             inline void unpauseTimer()
                 { this->bActive_ = true; }
-            /// Returns true if the Timer is active (neither stopped nor paused).
+            /// Returns true if the timer is active (neither stopped nor paused).
             inline bool isActive() const
                 { return this->bActive_; }
-            /// Returns the remaining time until the Timer calls the executor.
+            /// Returns the remaining time until the timer calls the executor.
             inline float getRemainingTime() const
                 { return static_cast<float>(this->time_ / 1000000.0f); }
-            /// Increases the remaining time of the Timer by the given amount of time (in seconds).
+            /// Increases the remaining time of the timer by the given amount of time (in seconds).
             inline void addTime(float time)
                 { if (time > 0.0f) this->time_ += static_cast<long long>(time * 1000000.0f); }
-            /// Decreases the remaining time of the Timer by the given amount of time (in seconds)
+            /// Decreases the remaining time of the timer by the given amount of time (in seconds)
             inline void removeTime(float time)
                 { if (time > 0.0f) this->time_ -= static_cast<long long>(time * 1000000.0f); }
@@ -156,4 +164,7 @@
             void tick(const Clock& time);
 
+        protected:
+            virtual float getTimeFactor();
+
         private:
             void init();
@@ -163,9 +174,25 @@
             long long interval_;    //!< The time-interval in micro seconds
             bool bLoop_;            //!< If true, the executor gets called every @a interval seconds
-            bool bActive_;          //!< If true, the Timer ticks and calls the executor if the time's up
+            bool bActive_;          //!< If true, the timer ticks and calls the executor if the time's up
             bool bKillAfterCall_;   //!< If true the timer gets deleted after it expired and called the executor
 
             long long time_;        //!< Internal variable, counting the time untill the next executor-call
     };
+
+    /**
+        @brief RealTimer is a helper class that executes a function after a given amount of seconds in real-time.
+
+        The time interval of RealTimer doesn't depend on the game time, it will also call the function
+        if the game is paused. See Timer for a timer class that depends on the game time.
+    */
+    class _ToolsExport RealTimer : public Timer
+    {
+        public:
+            RealTimer();
+            RealTimer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false);
+
+        protected:
+            virtual float getTimeFactor();
+    };
 }
 
Index: code/branches/tutorial/src/libraries/tools/ToolsPrereqs.h
===================================================================
--- code/branches/tutorial/src/libraries/tools/ToolsPrereqs.h	(revision 8010)
+++ code/branches/tutorial/src/libraries/tools/ToolsPrereqs.h	(revision 8051)
@@ -85,4 +85,5 @@
     class Mesh;
     class ParticleInterface;
+    class RealTimer;
     class ResourceCollection;
     class ResourceLocation;
