Index: code/branches/usability/data/defaultConfig/keybindings.ini
===================================================================
--- code/branches/usability/data/defaultConfig/keybindings.ini	(revision 8034)
+++ code/branches/usability/data/defaultConfig/keybindings.ini	(revision 8035)
@@ -19,5 +19,5 @@
 KeyDelete="scale 1 rotateRoll"
 KeyDivide=
-KeyDown="scale -1 moveFrontBack"
+KeyDown="scale -1 moveFrontBack | navigateGUI down"
 KeyE="scale -1 rotateRoll"
 KeyEnd=boost
@@ -52,5 +52,5 @@
 KeyKanji=
 KeyL=
-KeyLeft="scale -1 moveRightLeft"
+KeyLeft="scale -1 moveRightLeft | navigateGUI left"
 KeyLeftAlt=
 KeyLeftBracket=
@@ -93,5 +93,5 @@
 KeyNumpadAdd=
 KeyNumpadComma=
-KeyNumpadEnter=
+KeyNumpadEnter="navigateGUI enter"
 KeyNumpadEquals=
 KeyNumpadPeriod=
@@ -108,6 +108,6 @@
 KeyQ="scale 1 rotateRoll"
 KeyR="scale 1 moveUpDown"
-KeyReturn=
-KeyRight="scale 1 moveRightLeft"
+KeyReturn="navigateGUI enter"
+KeyRight="scale 1 moveRightLeft | navigateGUI right"
 KeyRightAlt=
 KeyRightBracket=
@@ -126,5 +126,5 @@
 KeyTab="NewHumanController changeMode"
 KeyU=""
-KeyUP="scale 1 moveFrontBack"
+KeyUP="scale 1 moveFrontBack | navigateGUI up"
 KeyUnassigned="InGameConsole openConsole"
 KeyUnderline=
Index: code/branches/usability/data/gui/scripts/GUISheet.lua
===================================================================
--- code/branches/usability/data/gui/scripts/GUISheet.lua	(revision 8034)
+++ code/branches/usability/data/gui/scripts/GUISheet.lua	(revision 8035)
@@ -29,5 +29,5 @@
 
 -- Override this function if you want to react on keystrokes
-function P:onKeyPressed()
+function P:onKeyPressed(mode)
 end
 
@@ -85,20 +85,20 @@
 
 -- Handles key pressed while the gui sheed is displayed
-function P:keyPressed()
+function P:keyPressed(mode)
     if self.buttons then
-        if code == "208" then     -- key down
+        if mode == "down" then     -- key down
             self:moveSelectionRow(1)
-        elseif code == "200" then -- key up
+        elseif mode == "up" then -- key up
             self:moveSelectionRow(-1)
-        elseif code == "205" then -- key right
+        elseif mode == "right" then -- key right
             self:moveSelectionColumn(1)
-        elseif code == "203" then -- key left
+        elseif mode == "left" then -- key left
             self:moveSelectionColumn(-1)
-        elseif code == "28" or code == "156"  then -- key enter or key numpad enter
+        elseif mode == "enter" then -- key enter or key numpad enter
             self:pressSelectedButton()
         end
     end
 
-    self:onKeyPressed()
+    self:onKeyPressed(mode)
 end
 
Index: code/branches/usability/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/usability/data/gui/scripts/GraphicsMenu.lua	(revision 8034)
+++ code/branches/usability/data/gui/scripts/GraphicsMenu.lua	(revision 8035)
@@ -1,5 +1,5 @@
 -- GraphicsMenu.lua
 
-local P = createMenuSheet("GraphicsMenu")
+local P = createMenuSheet("GraphicsMenu", true, TriBool.True, TriBool.True)
 
 P.resolutionList = {"custom", "640 x 480", "720 x 480", "720 x 576", "800 x 600", "1024 x 600", "1024 x 768", "1152 x 864", "1280 x 720", "1280 x 800", "1280 x 960", "1280 x 1024", "1360 x 768", "1440 x 900", "1600 x 900", "1600 x 1200", "1680 x 1050"}
Index: code/branches/usability/data/gui/scripts/MenuSheet.lua
===================================================================
--- code/branches/usability/data/gui/scripts/MenuSheet.lua	(revision 8034)
+++ code/branches/usability/data/gui/scripts/MenuSheet.lua	(revision 8035)
@@ -16,5 +16,5 @@
     newSheet.bHidePrevious  = handleDefArg(_bHidePrevious,  true)
     newSheet.tShowCursor    = handleDefArg(_tShowCusor,     TriBool.True)
-    newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.True)
+    newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.Dontcare)
     newSheet.bBlockJoyStick = handleDefArg(_bBlockJoyStick, false)
 
Index: code/branches/usability/data/gui/scripts/SheetManager.lua
===================================================================
--- code/branches/usability/data/gui/scripts/SheetManager.lua	(revision 8034)
+++ code/branches/usability/data/gui/scripts/SheetManager.lua	(revision 8035)
@@ -5,7 +5,6 @@
 local activeMenuSheets = {size = 0, topSheetTuple = nil}
 local menuSheetsRoot = guiMgr:getMenuRootWindow()
-local bInGameConsoleClosed = false
 local mainMenuLoaded = false
-orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")
+--orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")
 orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "Sized", "windowResized")
 
@@ -132,4 +131,8 @@
     if previous and previous.pressedEnter and menuSheet:hasSelection() == false then
         menuSheet:setSelectionNear(1, 1)
+    end
+
+    if activeMenuSheets.size > 0 then
+        guiMgr:guisActiveChanged(true)
     end
 
@@ -204,4 +207,8 @@
     end
 
+    if activeMenuSheets.size == 0 then
+        guiMgr:guisActiveChanged(false)
+    end
+
     sheetTuple.sheet:quit()
 end
@@ -217,11 +224,5 @@
     -- HUGE, very HUGE hacks!
 
-    -- If the InGameConsole is active, ignore the ESC command.
-    if bInGameConsoleClosed == true then
-        bInGameConsoleClosed = false
-        return
-    end
-
-    -- Count the number of sheets that don't need input till the first that does.
+    -- Count the number of sheets that don't need input until the first that does.
     local counter = noInputSheetIndex()
 
@@ -237,17 +238,9 @@
 end
 
-function keyPressed(e)
-    local we = tolua.cast(e, "CEGUI::KeyEventArgs")
+-- Function to navigate the GUI, is called by the GUIManager, whenever a relevant key is pressed.
+-- The mode specifies the action to be taken.
+function navigateGUI(mode)
     local sheet = activeMenuSheets[activeMenuSheets.size]
-    code = tostring(we.scancode)
-    -- Some preprocessing
-    if not mainMenuLoaded and not sheet.bNoInput then
-        if code == "1" then
-            keyESC()
-        elseif code == "0"then
-            orxonox.CommandExecutor:execute("InGameConsole openConsole")
-        end
-    end
-    sheet.sheet:keyPressed()
+    sheet.sheet:keyPressed(mode)
 end
 
@@ -293,8 +286,4 @@
     end
     return counter
-end
-
-function inGameConsoleClosed()
-    bInGameConsoleClosed = not bInGameConsoleClosed;
 end
 
Index: code/branches/usability/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/usability/src/libraries/core/GUIManager.cc	(revision 8034)
+++ code/branches/usability/src/libraries/core/GUIManager.cc	(revision 8035)
@@ -103,7 +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";
 
     /**
@@ -364,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/usability/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/usability/src/libraries/core/GUIManager.h	(revision 8034)
+++ code/branches/usability/src/libraries/core/GUIManager.h	(revision 8035)
@@ -94,4 +94,7 @@
         void setBackgroundImage(const std::string& image);
 
+        static void navigateGUI(const std::string& mode);
+        void guisActiveChanged(bool active); // tolua_export
+
         //! Creates a new InputState to be used with a GUI Sheet
         const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export
@@ -124,4 +127,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/usability/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/usability/src/orxonox/gamestates/GSMainMenu.cc	(revision 8034)
+++ code/branches/usability/src/orxonox/gamestates/GSMainMenu.cc	(revision 8035)
@@ -68,5 +68,5 @@
         RegisterRootObject(GSMainMenu);
 
-        InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
+        InputManager::getInstance().createInputState("MainMenuHackery")->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
 
         // create an empty Scene
Index: code/branches/usability/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/usability/src/orxonox/overlays/InGameConsole.cc	(revision 8034)
+++ code/branches/usability/src/orxonox/overlays/InGameConsole.cc	(revision 8035)
@@ -49,5 +49,4 @@
 #include "core/ConfigValueIncludes.h"
 #include "core/command/ConsoleCommand.h"
-#include "core/GUIManager.h"
 #include "core/input/InputManager.h"
 #include "core/input/InputState.h"
@@ -534,5 +533,4 @@
         {
             this->bActive_ = false;
-            GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()"); // Notify the SheetManager in lua, that the console has been closed.
             InputManager::getInstance().leaveState("console");
             this->shell_->unregisterListener(this);
@@ -611,5 +609,4 @@
     /*static*/ void InGameConsole::closeConsole()
     {
-        GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()");  // Notify the SheetManager in lua, that the console has been closed, but not by ESC.
         InGameConsole::getInstance().deactivate();
     }
