Index: code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc	(revision 1638)
+++ code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc	(revision 1641)
@@ -46,4 +46,6 @@
 #include "core/ConsoleCommand.h"
 #include "core/input/InputManager.h"
+#include "core/input/SimpleInputState.h"
+#include "core/input/InputBuffer.h"
 #include "GraphicsEngine.h"
 
@@ -66,7 +68,4 @@
         , consoleOverlayBorder_(0)
         , consoleOverlayTextAreas_(0)
-        , emptySceneManager_(0)
-        , emptyCamera_(0)
-        , viewport_(0)
     {
         RegisterObject(InGameConsole);
@@ -118,4 +117,7 @@
     void InGameConsole::initialise()
     {
+        // create the corresponding input state
+        InputManager::createSimpleInputState("console", 40)->setKeyHandler(Shell::getInstance().getInputBuffer());
+
         // create overlay and elements
         Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
@@ -195,12 +197,4 @@
         Shell::getInstance().addOutputLevel(true);
 
-        // create a sceneManager in order to render in our own viewport
-        this->emptySceneManager_ = Ogre::Root::getSingleton()
-            .createSceneManager(Ogre::ST_GENERIC, "Console/EmptySceneManager");
-        this->emptyCamera_ = this->emptySceneManager_->createCamera("Console/EmptyCamera");
-        this->viewport_ = GraphicsEngine::getSingleton().getRenderWindow()->addViewport(emptyCamera_, 10);
-        this->viewport_->setOverlaysEnabled(true);
-        this->viewport_->setClearEveryFrame(false);
-
         COUT(4) << "Info: InGameConsole initialized" << std::endl;
     }
@@ -211,4 +205,11 @@
     void InGameConsole::destroy()
     {
+        this->deactivate();
+
+        // destroy the input state previously created
+        SimpleInputState * inputState = dynamic_cast<SimpleInputState*>(InputManager::getState("console"));
+        if (inputState)
+            InputManager::destroyState("console");
+
         Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
         if (ovMan)
@@ -467,8 +468,8 @@
                 if (output.size() > this->maxCharsPerLine_)
                 {
-                    if (Shell::getInstance().getInputBuffer().getCursorPosition() < this->inputWindowStart_)
-                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition();
-                    else if (Shell::getInstance().getInputBuffer().getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
-                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition() - this->maxCharsPerLine_ + 1;
+                    if (Shell::getInstance().getInputBuffer()->getCursorPosition() < this->inputWindowStart_)
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition();
+                    else if (Shell::getInstance().getInputBuffer()->getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition() - this->maxCharsPerLine_ + 1;
 
                     output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_);
Index: code/branches/gui/src/orxonox/overlays/console/InGameConsole.h
===================================================================
--- code/branches/gui/src/orxonox/overlays/console/InGameConsole.h	(revision 1638)
+++ code/branches/gui/src/orxonox/overlays/console/InGameConsole.h	(revision 1641)
@@ -100,8 +100,4 @@
         Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
 
-        Ogre::SceneManager* emptySceneManager_;     //!< dummy SceneManager to render overlays in empty windows
-        Ogre::Camera*       emptyCamera_;           //!< dummy camera to render overlays in empty windows
-        Ogre::Viewport*     viewport_;
-
         // config values
         float relativeWidth;
