Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 2, 2010, 11:30:44 PM (14 years ago)
Author:
dafrick
Message:

Some improvement on keypressed behaviour. Lua is acting up a little, though, don't yet know why exactly…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/menu/data/gui/scripts/SheetManager.lua

    r7403 r7607  
    55local activeMenuSheets = {size = 0, topSheetTuple = nil}
    66local menuSheetsRoot = guiMgr:getMenuRootWindow()
     7orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")
    78
    89-----------------------
     
    120121
    121122    menuSheet:show()
     123    menuSheetsRoot:activate()
    122124
    123125    return menuSheet
     
    213215end
    214216
     217function keyPressed(e)
     218    local we = tolua.cast(e, "CEGUI::KeyEventArgs")
     219    local sheet = activeMenuSheets[activeMenuSheets.size]
     220    code = tostring(we.scancode)
     221    sheet.sheet:onKeyPressed()
     222end
     223
    215224function setBackgroundImage(imageSet, imageName)
    216225    guiMgr:setBackgroundImage(imageSet, imageName)
Note: See TracChangeset for help on using the changeset viewer.