Index: /code/branches/presentation2/data/gui/layouts/InfoPopup.layout
===================================================================
--- /code/branches/presentation2/data/gui/layouts/InfoPopup.layout	(revision 6266)
+++ /code/branches/presentation2/data/gui/layouts/InfoPopup.layout	(revision 6266)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="orxonox/InfoPopup_RootWindow" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="TaharezLook/StaticImage" Name="orxonox/InfoPopup_Background" >
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Property Name="Alpha" Value="0.6" />
+            <Window Type="TaharezLook/Button" Name="orxonox/InfoPopup_close" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Close" />
+                <Property Name="Alpha" Value="0.7" />
+                <Property Name="InheritsAlpha" Value="False" /> 
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.55,0},{0.6,0},{0.6,0}}" />
+                <Event Name="Clicked" Function="InfoPopup.close"/>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="orxonox/InfoPopup_text" >
+                <Property Name="Text" Value="Template text" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.4,0},{0.8,0},{0.5,0}}" />
+                <Property Name="InheritsAlpha" Value="False" /> 
+                <Property Name="Alpha" Value="0.8" />
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: /code/branches/presentation2/data/gui/layouts/KeyBindMenu.layout
===================================================================
--- /code/branches/presentation2/data/gui/layouts/KeyBindMenu.layout	(revision 6265)
+++ /code/branches/presentation2/data/gui/layouts/KeyBindMenu.layout	(revision 6266)
@@ -2,5 +2,5 @@
 
 <GUILayout >
-    <Window Type="DefaultWindow" Name="orxonox/KeyBindBackground" >
+    <Window Type="DefaultWindow" Name="orxonox/KeyBindMenu/Background" >
         <Property Name="InheritsAlpha" Value="False" />
         <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
@@ -14,5 +14,5 @@
             <Property Name="VertFormatting" Value="TopAligned" />
             <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.325,0},{0.75,0},{0.6,0}}" />
-            <Window Type="TaharezLook/ScrollablePane" Name="orxonox/KeyBindPane/" >
+            <Window Type="TaharezLook/ScrollablePane" Name="orxonox/KeyBindPane" >
                 <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" />
                 <Property Name="HorzStepSize" Value="0.1" />
@@ -24,8 +24,4 @@
                 <Property Name="HorzScrollPosition" Value="0" />
                 <Property Name="VertScrollPosition" Value="0" />
-                <AutoWindow NameSuffix="__auto_container__" >
-                    <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" />
-                    <Property Name="ChildExtentsArea" Value="l:0 t:0 r:0 b:0" />
-                </AutoWindow>
             </Window>
         </Window>
@@ -34,4 +30,5 @@
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.625,0},{0.6,0},{0.675,0}}" />
+            <Event Name="Clicked" Function="KeyBindMenu.KeyBindBackButton_clicked"/>
         </Window>
     </Window>
Index: /code/branches/presentation2/data/gui/scripts/DecisionPopup.lua
===================================================================
--- /code/branches/presentation2/data/gui/scripts/DecisionPopup.lua	(revision 6265)
+++ /code/branches/presentation2/data/gui/scripts/DecisionPopup.lua	(revision 6266)
@@ -28,5 +28,5 @@
         P.functionPtr(true)
     end
-    orxonox.CommandExecutor:execute("hideGUI DecisionPopup")
+    hideGUI("DecisionPopup")
 end
 
@@ -35,5 +35,5 @@
         P.functionPtr(false)
     end
-    orxonox.CommandExecutor:execute("hideGUI DecisionPopup")
+    hideGUI("DecisionPopup")
 end
 
Index: /code/branches/presentation2/data/gui/scripts/GUITools.lua
===================================================================
--- /code/branches/presentation2/data/gui/scripts/GUITools.lua	(revision 6265)
+++ /code/branches/presentation2/data/gui/scripts/GUITools.lua	(revision 6266)
@@ -1,6 +1,11 @@
 function openDecisionPopup( text, callbackPtr )
-    orxonox.CommandExecutor:execute("showGUI DecisionPopup false true")
---     showGUI("DecisionPopup", false, true)
-    DecisionPopup.setCallback(InGameMenu.callback)
+    showGUI("DecisionPopup", false, true)
+    DecisionPopup.setCallback(callbackPtr)
     DecisionPopup.setText(text)
 end
+
+function openInfoPopup( text, functionPtr )
+    showGUI("InfoPopup", false, true)
+    InfoPopup.setDo(functionPtr)
+    InfoPopup.setText(text)
+end
Index: /code/branches/presentation2/data/gui/scripts/InfoPopup.lua
===================================================================
--- /code/branches/presentation2/data/gui/scripts/InfoPopup.lua	(revision 6266)
+++ /code/branches/presentation2/data/gui/scripts/InfoPopup.lua	(revision 6266)
@@ -0,0 +1,34 @@
+-- InfoPopup.lua
+
+BasicGUI = require("BasicGUI")
+local P = BasicGUI:new() --inherit everything from the gui package
+if _REQUIREDNAME == nil then
+    InfoPopup = P
+else
+    _G[_REQUIREDNAME] = P
+end
+
+P.filename = "InfoPopup"
+P.layoutString = "InfoPopup.layout"
+
+function P:init()
+end
+
+function P.setDo(functionPtr)
+    P.functionPtr = functionPtr
+    if P.functionPtr ~= nil then
+        P.functionPtr()
+    end
+end
+
+function P.setText( text )
+    winMgr:getWindow("orxonox/InfoPopup_text"):setText( text )
+end
+
+-- events for ingamemenu
+function P.close(e)
+    hideGUI("InfoPopup")
+end
+
+return P
+
Index: /code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua
===================================================================
--- /code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua	(revision 6265)
+++ /code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua	(revision 6266)
@@ -222,2 +222,6 @@
     return nil
 end
+
+function test(e)
+    debug(0, "Blubb")
+end
Index: /code/branches/presentation2/data/gui/scripts/KeyBindMenu.lua
===================================================================
--- /code/branches/presentation2/data/gui/scripts/KeyBindMenu.lua	(revision 6265)
+++ /code/branches/presentation2/data/gui/scripts/KeyBindMenu.lua	(revision 6266)
@@ -1,17 +1,65 @@
--- NewMouseControlsMenu.lua
+-- KeyBindMenu.lua
 
 BasicGUI = require("BasicGUI")
 local P = BasicGUI:new() --inherit everything from the gui package
 if _REQUIREDNAME == nil then
-    NewMouseControlsMenu = P
+    KeyBindMenu = P
 else
     _G[_REQUIREDNAME] = P
 end
 
-P.filename = "NewMouseControlsMenu"
-P.layoutString = "NewMouseControlsMenu.layout"
+P.filename = "KeyBindMenu"
+P.layoutString = "KeyBindMenu.layout"
+
+function P:init()
+    commandList = {}
+    table.insert(commandList, "fire 0")
+    table.insert(commandList, "fire 1")
+    table.insert(commandList, "fire 2")
+
+    local lineHeight = 30
+    
+    local window = winMgr:getWindow("orxonox/KeyBindPane")
+
+    for k,v in pairs(commandList) do
+        local button = winMgr:createWindow("TaharezLook/Button", "orxonox/KeyBindPane/Binding" .. k .. "/Button")
+        local command = winMgr:createWindow("TaharezLook/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command")
+        local line = winMgr:createWindow("DefaultWindow", "orxonox/KeyBindPane/Binding" .. k)
+        
+        line:setSize(CEGUI.UVector2(CEGUI.UDim(1,-13),CEGUI.UDim(0, lineHeight)))
+        button:setSize(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(1, 0)))
+        command:setSize(CEGUI.UVector2(CEGUI.UDim(0.6, 0), CEGUI.UDim(1, 0)))
+        
+        button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.6, 0),CEGUI.UDim(0, 0)))
+        command:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0),CEGUI.UDim(0, 0)))
+        line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0),CEGUI.UDim(0, lineHeight*(k-1))))
+        
+        button:setText(orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(v))
+        command:setText(v)
+        
+        orxonox.KeyBinderManager:getInstance():subscribeEventHelper(button, "Clicked", P.filename .. ".KeyBindButton_clicked")
+        --button:subscribeScriptedEvent("EventClicked", P.filename .. ".KeyBindButton_clicked")
+        
+        line:addChildWindow(command)
+        line:addChildWindow(button)
+        window:addChildWindow(line)
+    end
+end
+
+function P.KeyBindButton_clicked(e)
+    local we = CEGUI.toWindowEventArgs(e)
+    local name = we.window:getName()
+    commandNr = tonumber(string.match(name, "%d+"))
+    
+    openInfoPopup("Press any button/key or move a mouse/joystick axis.", KeyBindMenu.keybind)
+
+end
+
+function P.keybind()
+    orxonox.KeyBinderManager:getInstance():keybind(commandList[commandNr])
+end
 
 function P.KeyBindBackButton_clicked(e)
-    hideGUI("NewMouseControlsMenu")
+    hideGUI("KeyBindMenu")
     debug("event: back")
 end
Index: /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc	(revision 6265)
+++ /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc	(revision 6266)
@@ -37,4 +37,6 @@
 #include "InputManager.h"
 #include "KeyDetector.h"
+
+#include <CEGUIWindow.h>
 
 namespace orxonox
@@ -90,4 +92,9 @@
         else
             this->bDefaultFileLoaded_ = false;
+    }
+    
+    void KeyBinderManager::subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function)
+    {
+        window->subscribeScriptedEvent(event, function);
     }
 
Index: /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h
===================================================================
--- /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h	(revision 6265)
+++ /code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h	(revision 6266)
@@ -36,4 +36,6 @@
 #include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
+
+#include <CEGUIForwardRefs.h>
 
 namespace orxonox //tolua_export
@@ -79,4 +81,6 @@
         void setToDefault()
             { this->setCurrent(this->defaultFilename_); }
+            
+        void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export
 
         //! Returns a pointer to a KeyBinder (creates it if not yet loaded)
@@ -91,6 +95,5 @@
 
         //! 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)
