Index: /code/branches/usability/data/gui/scripts/AudioMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/AudioMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/AudioMenu.lua	(revision 7922)
@@ -2,11 +2,4 @@
 
 local P = createMenuSheet("AudioMenu")
-
-P.buttonList = {}
-
-function P.onShow()
-    P.oldindex = -2
-    P.index = -1
-end
 
 function P.onLoad()
@@ -50,9 +43,9 @@
     end
 
-    local item = {
+    P:initButtons(1, 1)
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/AudioBackButton"),
-            ["function"]  = P.AudioBackButton_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.AudioBackButton_clicked
+    })
 end
 
@@ -185,8 +178,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 1, 1)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/ControlsMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/ControlsMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/ControlsMenu.lua	(revision 7922)
@@ -2,35 +2,26 @@
 
 local P = createMenuSheet("ControlsMenu")
-P.buttonList = {}
 P.loadAlong = { "MouseControlsMenu", "KeyBindMenu" }
 
 function P.onLoad()
-    P.multiplayerMode = "startClient" 
+    P.multiplayerMode = "startClient"
 
     --buttons are arranged in a 3x1 matrix:
-    local item = {
+    P:initButtons(3, 1)
+
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/MouseControlsButton"),
-            ["function"]  = P.ControlsMouseControlsButton_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.ControlsMouseControlsButton_clicked
+    })
 
-    local item = {
+    P:setButton(2, 1, {
             ["button"] = winMgr:getWindow("orxonox/KeybindingsButton"),
-            ["function"]  = P.ControlsKeyboardControlsButton_clicked
-    }
-    P.buttonList[2] = item
+            ["callback"]  = P.ControlsKeyboardControlsButton_clicked
+    })
 
-    local item = {
+    P:setButton(3, 1, {
             ["button"] = winMgr:getWindow("orxonox/ControlsBackButton"),
-            ["function"]  = P.ControlsBackButton_clicked
-    }
-    P.buttonList[3] = item
-
-end
-
-function P.onShow()
-    --indices to iterate through buttonlist
-    P.oldindex = -2
-    P.index = -1
+            ["callback"]  = P.ControlsBackButton_clicked
+    })
 end
 
@@ -47,8 +38,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 3, 1)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/CreditsMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/CreditsMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/CreditsMenu.lua	(revision 7922)
@@ -3,20 +3,15 @@
 local P = createMenuSheet("CreditsMenu")
 
-P.buttonList = {}
 P.scrollbarWidth = 13
 
 function P.onLoad()
-    local item = {
+    P:initButtons(1, 1)
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/CreditsBackButton"),
-            ["function"]  = P.CreditsBackButton_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.CreditsBackButton_clicked
+    })
 end
 
 function P.onShow()
-    --indices to iterate through buttonlist
-    P.oldindex = -2
-    P.index = -1
-
     local description = winMgr:getWindow("orxonox/CreditsText")
     description:setProperty("HorzFormatting", "WordWrapLeftAligned")
@@ -33,8 +28,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 1, 1)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/DecisionPopup.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/DecisionPopup.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/DecisionPopup.lua	(revision 7922)
@@ -3,27 +3,22 @@
 local P = createMenuSheet("DecisionPopup")
 
-P.buttonList = {}
-
-function P.onShow()
-    --indices to iterate through buttonlist
-    P.oldindex = -2
-    P.index = -1
-end
-
 function P.onLoad()
 
     --button are arranged in a 1x2 matrix
-    local item = {
+    P:initButtons(1, 2)
+
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_yes"),
-            ["function"]  = P.button_yes
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.button_yes
+    })
 
-    local item = {
+    P:setButton(1, 2, {
             ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_no"),
-            ["function"]  = P.button_no
-    }
-    P.buttonList[2] = item
+            ["callback"]  = P.button_no
+    })
+end
 
+function P.onShow()
+    P:setSelection(1, 1)
 end
 
@@ -51,8 +46,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 1, 2)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/GUISheet.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/GUISheet.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/GUISheet.lua	(revision 7922)
@@ -16,4 +16,16 @@
 end
 
+-- Override this function if you need to do work on show
+function P:onShow()
+end
+
+-- Override this function if you need to do work on hide
+function P:onHide()
+end
+
+-- Override this function if you need to do work just after the sheet has been hidden
+function P:onAfterHide()
+end
+
 -- show function for the GUI
 function P:show()
@@ -21,9 +33,10 @@
     self.bVisible = true
 
+    -- set the selected button's state
+    if self.buttons and self:hasSelection() then
+        self:setButtonStateSelected()
+    end
+
     self:onShow()
-end
-
--- Override this function if you need to do work on show
-function P:onShow()
 end
 
@@ -36,10 +49,11 @@
 end
 
--- Override this function if you need to do work on hide
-function P:onHide()
-end
-
--- Override this function if you need to do work just after the sheet has been hidden
 function P:afterHide()
+    -- reset the selected button
+    if self.buttons then
+        self:resetSelection()
+    end
+
+    self:onAfterHide()
 end
 
@@ -64,5 +78,197 @@
 end
 
-function P:onKeyPressed(e)
+-- Handles key pressed while the gui sheed is displayed
+function P:keyPressed()
+    if self.buttons then
+        if code == "208" then     -- key down
+            self:moveSelection(1, 0)
+        elseif code == "200" then -- key up
+            self:moveSelection(-1, 0)
+        elseif code == "205" then -- key right
+            self:moveSelection(0, 1)
+        elseif code == "203" then -- key left
+            self:moveSelection(0, -1)
+        elseif code == "28"  then -- key enter
+            self:pressSelectedButton()
+        end
+    end
+
+    self.onKeyPressed()
+end
+
+-- Override this function if you want to ract on keystrokes
+function P:onKeyPressed()
+end
+
+
+-------------------------------------------------------------------------------
+-- Keyboard control -----------------------------------------------------------
+-------------------------------------------------------------------------------
+
+-- Initializes the buttons table, used to control the menu with the keyboard
+function P:initButtons(rows, columns)
+    self.rows = rows
+    self.columns = columns
+    self.buttons = {}
+    self.selectedRow = 0
+    self.selectedColumn = 0
+end
+
+-- Defines the button for a given position in the table. The upper-left button is at position (1, 1)
+function P:setButton(row, column, button)
+    assert(self.rows ~= nil and self.columns ~= nil and self.buttons ~= nil, "You have to call initButtons() before using setButton()")
+    assert(row > 0 and column > 0 and row <= self.rows and column <= self.columns, "(" .. row .. "/" .. column .. ") is not in the valid bounds of the table (1/1)-(" .. self.rows .. "/" .. self.columns .. ")")
+
+    self.buttons[(row - 1) * self.columns + (column - 1)] = button
+end
+
+-- Returns the button at a given position in the table. The upper-left button is at position (1, 1)
+function P:getButton(row, column)
+    assert(row > 0 and column > 0 and row <= self.rows and column <= self.columns, "(" .. row .. "/" .. column .. ") is not in the valid bounds of the table (1/1)-(" .. self.rows .. "/" .. self.columns .. ")")
+
+    return self.buttons[(row - 1) * self.columns + (column - 1)]
+end
+
+-- Returns the selected button
+function P:getSelectedButton()
+    assert(self.selectedRow > 0 and self.selectedColumn > 0, "no button selected")
+
+    return self:getButton(self.selectedRow, self.selectedColumn)
+end
+
+-- Presses the selected button if any
+function P:pressSelectedButton()
+    if self:hasSelection() then
+        self:getSelectedButton().callback()
+    end
+end
+
+-- Sets the selection to a given row and column. The upper-left button is at position (1, 1)
+function P:setSelection(row, column)
+    assert(row > 0 and column > 0 and row <= self.rows and column <= self.columns, "(" .. row .. "/" .. column .. ") is not in the valid bounds of the table (1/1)-(" .. self.rows .. "/" .. self.columns .. ")")
+
+    if self:hasSelection() then
+        self:setButtonStateNormal()
+    end
+
+    self.selectedRow = row
+    self.selectedColumn = column
+
+    self:setButtonStateSelected()
+end
+
+-- Moves the selection by a given number of rows and columns (positive values mean increasing row/column, negative values mean decreasing row/column)
+function P:moveSelection(relRow, relColumn)
+    -- if there's no selection yet, prepare it such that the selection enters the table from the desired side
+    if self:hasSelection() == false then
+        -- note: we assume either relRow or relColumn is 0, thus no diagonal movement. therefore the following checks can be separated
+        if relRow > 0 then
+            self.selectedRow = 0
+            self.selectedColumn = 1
+        elseif relRow < 0 then
+            self.selectedRow = self.rows + 1
+            self.selectedColumn = 1
+        end
+
+        if relColumn > 0 then
+            self.selectedRow = 1
+            self.selectedColumn = 0
+        elseif relColumn < 0 then
+            self.selectedRow = 1
+            self.selectedColumn = self.columns + 1
+        end
+    else
+        self:setButtonStateNormal()
+    end
+
+    -- move the selection according to the parameters
+    self.selectedRow = self.selectedRow + relRow
+    self.selectedColumn = self.selectedColumn + relColumn
+
+    -- wrap around on overflow
+    while self.selectedRow > self.rows do
+        self.selectedRow = self.selectedRow - self.rows
+    end
+    while self.selectedColumn > self.columns do
+        self.selectedColumn = self.selectedColumn - self.columns
+    end
+
+    -- wrap around on underflow
+    while self.selectedRow <= 0 do
+        self.selectedRow = self.selectedRow + self.rows
+    end
+    while self.selectedColumn <= 0 do
+        self.selectedColumn = self.selectedColumn + self.columns
+    end
+
+    -- if the button is deactivated, call this function again
+    if self:getSelectedButton() == nil then
+        self:moveSelection(relRow, relColumn)
+    else
+        self:setButtonStateSelected()
+    end
+end
+
+-- Resets the selection
+function P:resetSelection()
+    if self:hasSelection() then
+        self:setButtonStateNormal()
+    end
+
+    self.selectedRow = 0
+    self.selectedColumn = 0
+end
+
+-- Determines if a button is selected
+function P:hasSelection()
+    if self.selectedRow == 0 or self.selectedColumn == 0 then
+        return false
+    else
+        return true
+    end
+end
+
+-- Sets the selected button's state to normal
+function P:setButtonStateNormal()
+    self:setButtonState("Normal")
+end
+
+-- Sets the selected button's state to selected
+function P:setButtonStateSelected()
+    self:setButtonState("Selected")
+end
+
+-- Sets the selected button's state to pushed
+function P:setButtonStatePushed()
+    self:setButtonState("Pushed")
+end
+
+-- Sets the selected button's state
+function P:setButtonState(state)
+    if self:getSelectedButton() then
+        local element = self:getSelectedButton().button
+        local offset = getElementStateOffset(element)
+
+        if offset then
+            element:setProperty("NormalImageRightEdge",  string.sub(element:getProperty("NormalImageRightEdge"),  1, offset) .. state)
+            element:setProperty("NormalImageLeftEdge",   string.sub(element:getProperty("NormalImageLeftEdge"),   1, offset) .. state)
+            element:setProperty("NormalImageBackground", string.sub(element:getProperty("NormalImageBackground"), 1, offset) .. state)
+        end
+    end
+end
+
+-- Gets the offset of the button's current state
+function getElementStateOffset(element)
+    local property = element:getProperty("NormalImageRightEdge")
+
+    if string.sub(property, string.len(property) - 5, string.len(property)) == "Normal" then
+        return -7
+    elseif string.sub(property, string.len(property) - 7, string.len(property)) == "Selected" then
+        return -9
+    elseif string.sub(property, string.len(property) - 5, string.len(property)) == "Pushed" then
+        return -7
+    else
+        return nil
+    end
 end
 
Index: /code/branches/usability/data/gui/scripts/GUITools.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/GUITools.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/GUITools.lua	(revision 7922)
@@ -54,283 +54,2 @@
     return height
 end
-
---function to iterate through a menu sheet by using arrowkeys
-
---@arguments:
---  list: 2-dimensional table, arguments are items that contain a button and its function
---        !!note: each button can only be in the list once!!
---  code: code of any key on the keyboard
---  P: menusheet
---  n: number of rows of the buttontable
---  m: number of colums of the buttontable
-
-function buttonIteratorHelper(list, code, P, n, m)
-
-    --after a key (down,up,left,right) is pressed the index of the current button has to be updated    
-
-    --key down
-    if code == "208" then
-        if P.index < 0 then     -- initial status
-            P.index = 0
-            P.oldindex = -1
-        else
-            P.oldindex = P.index
-            P.index = (P.index + m) % (m*n)     --modulo operation works as a "wrap around" in the button menu
-                                                
-            while list[P.index+1] == nil do     
-                P.oldindex = P.index
-                P.index = (P.index + m) % (m*n)
-            end
-        end
-
-    --key up
-    elseif code == "200" then
-        if P.index < 0 then
-            P.index = 0
-            P.oldindex = -1
-        elseif(P.index == 0) then
-            P.oldindex = P.index
-            P.index = m*n-m
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = (P.index-m)%(m*n)
-            end
-        else
-            P.oldindex = P.index
-            P.index = (P.index -m) % (m*n)
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = (P.index-m)%(m*n)
-            end
-        end
-
-    --key right
-    elseif code == "205" then
-        if P.index < 0 then
-            P.index = 0
-            P.oldindex = -1
-        elseif (P.index+1) % m == 0 then     -- we are at the right-end of a row
-            P.oldindex = P.index
-            P.index = P.index + 1 -m
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = P.index + 1
-            end
-        else
-            P.oldindex = P.index
-            P.index = P.index + 1
-
-            while list[P.index+1] == nil do
-                if (P.index+1) % m == 0 then     -- we are at the right-end of a row
-                    P.oldindex = P.index
-                    P.index = P.index + 1-m
-
-                else    
-                    P.oldindex = P.index
-                    P.index = P.index + 1
-                end
-            end
-        end    
-
-    --key left
-    elseif code == "203" then
-        if P.index < 0 then
-            P.index = 0
-            P.oldindex = -1
-        elseif P.index % m == 0 then         -- we are at the left-end of a row 
-            P.oldindex = P.index
-            P.index = P.index +m-1
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = P.index -1
-            end
-        else
-            P.oldindex = P.index
-            P.index = P.index -1
-
-            while list[P.index+1] == nil do
-                if P.index % m == 0 then     -- we are at the left-end of a row 
-                    P.oldindex = P.index
-                    P.index = P.index -1 + m
-                else                
-                    P.oldindex = P.index
-                    P.index = P.index -1
-                end
-            end   
-        end
-    end
-       
-    --to update the new current button
-    if (code == "208" or code == "200" or code == "203" or code == "205") and P.oldindex~= P.index then
-
-        local system = CEGUI.System:getSingleton()
-        local window = winMgr:getWindow("orxonox/MainMenuBackground")
-
-        local item = list[P.index+1]
-        local child = item["button"]
-        local s = child:getProperty("NormalImageRightEdge") 
-
-        --teste ob der Button nicht schon gehighlightet ist
-        if string.sub(s,string.len(s)-8,string.len(s)) == "Highlight" then
-            --nop
-        else
-            child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-7) .. "Highlight")
-            child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-7) .. "Highlight")
-            child:setProperty("NormalImageBackground", string.sub(child:getProperty("NormalImageBackground"),1,-7) .. "Highlight")
-            if P.oldindex >= 0 then
-                if list[P.oldindex+1] ~= nil then
-                    local item = list[P.oldindex+1]
-                    local oldChild = item["button"]
-                    oldChild:setProperty("NormalImageRightEdge", string.sub(oldChild:getProperty("NormalImageRightEdge"),1,-10) .. "Normal")
-                    oldChild:setProperty("NormalImageLeftEdge", string.sub(oldChild:getProperty("NormalImageLeftEdge"),1,-10) .. "Normal")
-                    oldChild:setProperty("NormalImageBackground", string.sub(oldChild:getProperty("NormalImageBackground"),1,-10) .. "Normal")
-                end
-            end
-        end
-
-        --for every highlighted button check if index is on its position. If not, set imageproperty on "normal"
-        local i = 1
-        while i < (n*m) do
-            if i == P.index +1 then 
-                i = i+1
-            else
-                if list[i] ~= nil then 
-                local item = list[i]
-                local child = item["button"]
-                local s = child:getProperty("NormalImageRightEdge")
-                    if string.sub(s,string.len(s)-8,string.len(s)) == "Highlight" then
-                        child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-10) .. "Normal")
-                        child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-10) .. "Normal")
-                        child:setProperty("NormalImageBackground", string.sub(child:getProperty("NormalImageBackground"),1,-10) .. "Normal")
-                    end
-                end
-            end
-                i=i+1
-        end
-    end  
-
-    --enter
-    if code == "28" and P.index >= 0 then
-        local item = list[P.index+1]
-        local child = item["button"] 
-        child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-10) .. "Normal")
-        child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-10) .. "Normal")
-        child:setProperty("NormalImageBackground", string.sub(child:getProperty("NormalImageBackground"),1,-10) .. "Normal")
-
-        local foo = item["function"]
-        foo()
-    end
-
-end
-
---write index and oldindex on the console
---works like buttonIteratorHelper
-function indexTester(list,code,P,n,m)
-    --key down
-    if code == "208" then
-        if P.index < 0 then     -- initial status
-            P.index = 0
-            P.oldindex = -1
-        else
-            P.oldindex = P.index
-            P.index = (P.index + m) % (m*n)
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = (P.index + m) % (m*n)
-            end
-        end
-
-    --key up
-    elseif code == "200" then
-        if P.index < 0 then
-            P.index = 0
-            P.oldindex = -1
-        elseif(P.index == 0) then
-            P.oldindex = P.index
-            P.index = m*n-m
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = (P.index-m)%(m*n)
-            end
-        else
-            P.oldindex = P.index
-            P.index = (P.index -m) % (m*n)
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = P.index -m
-            end
-        end
-
-    --key right
-    elseif code == "205" then
-        if P.index < 0 then
-            P.index = 0
-            P.oldindex = -1
-        elseif (P.index+1) % m == 0 then     -- we are at the right-end of a row
-            P.oldindex = P.index
-            P.index = P.index + 1 -m
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = P.index + 1
-            end
-        else
-            P.oldindex = P.index
-            P.index = P.index + 1
-
-            while list[P.index+1] == nil do
-                if (P.index+1) % m == 0 then     -- we are at the right-end of a row
-                    P.oldindex = P.index
-                    P.index = P.index + 1-m
-
-                else    
-                    P.oldindex = P.index
-                    P.index = P.index + 1
-                end
-            end
-        end    
-
-    --key left
-    elseif code == "203" then
-        if P.index < 0 then
-            P.index = 0
-            P.oldindex = -1
-        elseif P.index % m == 0 then         -- we are at the left-end of a row 
-            P.oldindex = P.index
-            P.index = P.index +m-1
-
-            while list[P.index+1] == nil do
-                P.oldindex = P.index
-                P.index = P.index -1
-            end
-        else
-            P.oldindex = P.index
-            P.index = P.index -1
-
-            while list[P.index+1] == nil do
-                if P.index % m == 0 then     -- we are at the left-end of a row 
-                    P.oldindex = P.index
-                    P.index = P.index -1 + m
-                else                
-                    P.oldindex = P.index
-                    P.index = P.index -1
-                end
-            end   
-        end
-    end    
-
-    cout(0, P.oldindex)
-    cout(0, P.index)
-
-end
-
-
-
-
Index: /code/branches/usability/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/GraphicsMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/GraphicsMenu.lua	(revision 7922)
@@ -3,12 +3,5 @@
 local P = createMenuSheet("GraphicsMenu")
 
-P.buttonList = {}
 P.schemeList = {"TaharezGreen", "Orxonox"}
-
-function P.onShow()
-    --indices to iterate through buttonlist (trivial in this menu sheet)
-    P.oldindex = -2
-    P.index = -1
-end
 
 function P.onLoad()
@@ -93,9 +86,9 @@
     block = false
 
-    local item = {
+    P:initButtons(1, 1)
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/GraphicsBackButton"),
-            ["function"]  = P.GraphicsBackButton_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.GraphicsBackButton_clicked
+    })
 
     local dropbox = winMgr:getWindow("orxonox/ThemeDropBox")
@@ -233,8 +226,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 1, 1)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/HostMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/HostMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/HostMenu.lua	(revision 7922)
@@ -5,5 +5,4 @@
 P.multiplayerMode = "startServer"
 
-P.buttonList = {}
 P.levelList = {}
 P.itemList = {}
@@ -11,5 +10,5 @@
 
 function P.onLoad()
-    P.multiplayerMode = "startServer" 
+    P.multiplayerMode = "startServer"
     local window = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
     local button = tolua.cast(window,"CEGUI::Checkbox")
@@ -17,15 +16,15 @@
     P.createLevelList()
 
-    local item = {
+    P:initButtons(1, 2)
+
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/HostMenuStartButton"),
-            ["function"]  = P.HostMenuStartButton_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.HostMenuStartButton_clicked
+    })
 
-    local item = {
+    P:setButton(1, 2, {
             ["button"] = winMgr:getWindow("orxonox/HostMenuBackButton"),
-            ["function"]  = P.HostMenuBackButton_clicked
-    }
-    P.buttonList[2] = item
+            ["callback"]  = P.HostMenuBackButton_clicked
+    })
 end
 
@@ -44,8 +43,4 @@
         P.createLevelList()
     end
-
-    P.oldindex = -2
-    P.index = -1
-
 end
 
@@ -97,5 +92,5 @@
 end
 
-function P.HostMenuStartButton_clicked(e)    
+function P.HostMenuStartButton_clicked(e)
     local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/HostMenuListbox"))
     local choice = listbox:getFirstSelectedItem()
@@ -119,7 +114,3 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 1, 2)
-end
-
 return P
Index: /code/branches/usability/data/gui/scripts/InGameMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/InGameMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/InGameMenu.lua	(revision 7922)
@@ -4,40 +4,35 @@
 P.loadAlong = { "DecisionPopup" }
 
-P.buttonList = {}
-
 function P.onLoad()
-    P.multiplayerMode = "startClient" 
+    P.multiplayerMode = "startClient"
 
     --button are arranged in a 4x1 matrix, the left lower item is nil
-    local item = {
+    P:initButtons(4, 1)
+
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"),
-            ["function"]  = P.button_settings_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.button_return_clicked
+    })
 
-    local item = {
+    P:setButton(2, 1, {
             ["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"),
-            ["function"]  = P.button_mainmenu_clicked
-    }
-    P.buttonList[2] = item
+            ["callback"]  = P.button_mainmenu_clicked
+    })
 
-    local item = {
+    P:setButton(3, 1, {
             ["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"),
-            ["function"]  = P.button_settings_clicked
-    }
-    P.buttonList[3] = item
+            ["callback"]  = P.button_settings_clicked
+    })
 
-    local item = {
+    P:setButton(4, 1, {
             ["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"),
-            ["function"]  = P.button_quit_clicked
-    }
-    P.buttonList[4] = item
-
+            ["callback"]  = P.button_quit_clicked
+    })
 end
 
 function P.onShow()
-    --indices to iterate through buttonlist
-    P.oldindex = -2
-    P.index = -1
+    if P:hasSelection() == false then
+        P:setSelection(1, 1)
+    end
 end
 
@@ -64,13 +59,9 @@
         hideMenuSheet("InGameMenu")
         orxonox.execute("exit")
-    else 
+    else
         P.onShow()
     end
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 4, 1)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/MainMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/MainMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/MainMenu.lua	(revision 7922)
@@ -4,49 +4,37 @@
 P.loadAlong = { "SingleplayerMenu", "MultiplayerMenu", "SettingsMenu", "CreditsMenu" }
 
-P.buttonList = {}
-
 function P.onLoad()
     --buttons are arranged in a 6x1 Matrix (list)
-    local item = {
+    P:initButtons(6, 1)
+
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"),
-            ["function"]  = P.QuickGameTestButton_clicked
-    }
-    table.insert(P.buttonList,item)
+            ["callback"]  = P.QuickGameTestButton_clicked
+    })
 
-    item = {
+    P:setButton(2, 1, {
             ["button"] = winMgr:getWindow("orxonox/SingleplayerButton"),
-            ["function"]  = P.SingleplayerButton_clicked
-    }
-    table.insert(P.buttonList,item)
+            ["callback"]  = P.SingleplayerButton_clicked
+    })
 
-    item = {
+    P:setButton(3, 1, {
             ["button"] = winMgr:getWindow("orxonox/MultiplayerButton"),
-            ["function"]  = P.MultiplayerButton_clicked
-    }
-    table.insert(P.buttonList,item)
+            ["callback"]  = P.MultiplayerButton_clicked
+    })
 
-    item = {
+    P:setButton(4, 1, {
             ["button"] = winMgr:getWindow("orxonox/SettingsButton"),
-            ["function"]  = P.SettingsButton_clicked
-    }
-    table.insert(P.buttonList,item)
+            ["callback"]  = P.SettingsButton_clicked
+    })
 
-    item = {
+    P:setButton(5, 1, {
             ["button"] = winMgr:getWindow("orxonox/CreditsButton"),
-            ["function"]  = P.CreditsButton_clicked
-    }
-    table.insert(P.buttonList,item)
+            ["callback"]  = P.CreditsButton_clicked
+    })
 
-    item = {
+    P:setButton(6, 1, {
             ["button"] = winMgr:getWindow("orxonox/ExitButton"),
-            ["function"]  = P.ExitButton_clicked
-    }
-    table.insert(P.buttonList,item) 
-end
-
-function P.onShow()
-    --indices to iterate through buttonlist
-    P.oldindex = -2
-    P.index = -1
+            ["callback"]  = P.ExitButton_clicked
+    })
 end
 
@@ -77,8 +65,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 6, 1)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/MultiplayerMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/MultiplayerMenu.lua	(revision 7922)
@@ -2,6 +2,4 @@
 
 local P = createMenuSheet("MultiplayerMenu")
-
-P.buttonList = {}
 
 --joinMode is 1 for choice "LAN" and 2 for "Internet"
@@ -13,29 +11,24 @@
 
     --button are arranged in a 2x2 matrix, the left lower item is nil
-    local item = {
+    P:initButtons(2, 2)
+
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/MultiplayerJoinButton"),
-            ["function"]  = P.MultiplayerJoinButton_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.MultiplayerJoinButton_clicked
+    })
 
-    local item = {
+    P:setButton(1, 2, {
             ["button"] = winMgr:getWindow("orxonox/MultiplayerHostButton"),
-            ["function"]  = P.MultiplayerHostButton_clicked
-    }
-    P.buttonList[2] = item
+            ["callback"]  = P.MultiplayerHostButton_clicked
+    })
 
-    local item = {
+    P:setButton(2, 2, {
             ["button"] = winMgr:getWindow("orxonox/MultiplayerBackButton"),
-            ["function"]  = P.MultiplayerBackButton_clicked
-    }
-    P.buttonList[4] = item
+            ["callback"]  = P.MultiplayerBackButton_clicked
+    })
 end
 
 function P.onShow()
     --P.showServerList()
-
-    --indices to iterate through buttonlist
-    P.oldindex = -2
-    P.index = -1
 
     if P.joinMode == 1 then
@@ -158,8 +151,4 @@
 end
 
-function P.onKeyPressed()
-    buttonIteratorHelper(P.buttonList, code, P, 2, 2)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/NotificationLayer.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/NotificationLayer.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/NotificationLayer.lua	(revision 7922)
@@ -46,5 +46,5 @@
 end
 
--- Pushes an input notification to the input queue. 
+-- Pushes an input notification to the input queue.
 function P.pushNotification(queueName, notification)
     local queue = P.queueList[queueName]
@@ -333,5 +333,5 @@
 
 -- Is called after the sheet has been hidden.
-function P.afterHide()
+function P.onAfterHide()
     -- If we leave the edit mode we show the sheet again.
     if P.editMode then
Index: /code/branches/usability/data/gui/scripts/SettingsMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/SettingsMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/SettingsMenu.lua	(revision 7922)
@@ -4,46 +4,33 @@
 P.loadAlong = { "ControlsMenu", "AudioMenu", "GraphicsMenu" }
 
-P.buttonList = {}
-
 function P.onLoad()
     --"Gameplay" and "Multiplayer Options" are not integrated in the list
     --buttons are arranged in a 4x2 matrix. The lower-right element is not in the matrix!
-    local item = {
+    P:initButtons(4, 2)
+
+    P:setButton(1, 2, {
             ["button"] = winMgr:getWindow("orxonox/SettingsMenu/GraphicsButton"),
-            ["function"]  = P.SettingsGraphicsButton_clicked
-    }
-    P.buttonList[2] = item
+            ["callback"]  = P.SettingsGraphicsButton_clicked
+    })
 
-    local item = {
+    P:setButton(2, 2, {
             ["button"] = winMgr:getWindow("orxonox/SettingsMenu/AudioButton"),
-            ["function"]  = P.SettingsAudioButton_clicked
-    }
-    P.buttonList[4] = item
+            ["callback"]  = P.SettingsAudioButton_clicked
+    })
 
+    P:setButton(3, 1, {
+            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/ControlsButton"),
+            ["callback"]  = P.SettingsControlsButton_clicked
+    })
 
-    local item = {
-            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/ControlsButton"),
-            ["function"]  = P.SettingsControlsButton_clicked
-    }
-    P.buttonList[5] = item
+    P:setButton(3, 2, {
+            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/MiscellaneousButton"),
+            ["callback"]  = P.SettingsMiscellaneousButton_clicked
+    })
 
-    local item = {
-            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/MiscellaneousButton"),
-            ["function"]  = P.SettingsMiscellaneousButton_clicked
-    }
-    P.buttonList[6] = item
-
-    local item = {
+    P:setButton(4, 1, {
             ["button"] = winMgr:getWindow("orxonox/SettingsMenu/SettingsBackButton"),
-            ["function"]  = P.SettingsBackButton_clicked
-    }
-    P.buttonList[7] = item
-
-end
-
-function P.onShow()
-    --indices to iterate through buttonlist
-    P.oldindex = 3
-    P.index = 2
+            ["callback"]  = P.SettingsBackButton_clicked
+    })
 end
 
@@ -76,8 +63,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 4, 2)
-end
-
 return P
 
Index: /code/branches/usability/data/gui/scripts/SheetManager.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/SheetManager.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/SheetManager.lua	(revision 7922)
@@ -126,5 +126,5 @@
         end
     end
-    
+
     menuSheet:show()
     menuSheetsRoot:activate()
@@ -179,5 +179,5 @@
         inputMgr:leaveState(sheetTuple.sheet.inputState)
     end
-    
+
     -- CURSOR SHOWING
     local i = activeMenuSheets.size
@@ -245,5 +245,5 @@
         end
     end
-    sheet.sheet:onKeyPressed()
+    sheet.sheet:keyPressed()
 end
 
Index: /code/branches/usability/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- /code/branches/usability/data/gui/scripts/SingleplayerMenu.lua	(revision 7921)
+++ /code/branches/usability/data/gui/scripts/SingleplayerMenu.lua	(revision 7922)
@@ -3,5 +3,4 @@
 local P = createMenuSheet("SingleplayerMenu")
 
-P.buttonList = {}
 P.levelList = {}
 P.itemList = {}
@@ -15,15 +14,15 @@
 
     --buttons are arranged in a 1x2 matrix
-    local item = {
+    P:initButtons(1, 2)
+
+    P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
-            ["function"]  = P.SingleplayerStartButton_clicked
-    }
-    P.buttonList[1] = item
+            ["callback"]  = P.SingleplayerStartButton_clicked
+    })
 
-    local item = {
+    P:setButton(1, 2, {
             ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),
-            ["function"]  = P.SingleplayerBackButton_clicked
-    }
-    P.buttonList[2] = item
+            ["callback"]  = P.SingleplayerBackButton_clicked
+    })
 end
 
@@ -61,10 +60,4 @@
 end
 
-function P.onShow()
-    --indices to iterate through buttonlist
-    P.oldindex = -2
-    P.index = -1
-end
-
 function P.SingleplayerStartButton_clicked(e)
     local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox"))
@@ -93,8 +86,4 @@
 end
 
-function P.onKeyPressed() 
-    buttonIteratorHelper(P.buttonList, code, P, 1, 2)
-end
-
 return P
 
