Changeset 8051 for code/branches/tutorial/data/gui/scripts/GUISheet.lua
- Timestamp:
- Mar 9, 2011, 11:27:05 AM (14 years ago)
- Location:
- code/branches/tutorial
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutorial
- Property svn:mergeinfo changed
/code/branches/usability merged: 8018-8041
- Property svn:mergeinfo changed
-
code/branches/tutorial/data/gui/scripts/GUISheet.lua
r7928 r8051 28 28 end 29 29 30 -- Override this function if you want to react on keystrokes 31 function P:onKeyPressed(mode) 32 end 33 34 -- Override this function if you want to update the gui after the window was resized 35 function P:onWindowResized() 36 end 37 30 38 -- show function for the GUI 31 39 function P:show() … … 77 85 78 86 -- Handles key pressed while the gui sheed is displayed 79 function P:keyPressed( )87 function P:keyPressed(mode) 80 88 if self.buttons then 81 if code == "208" then -- key down89 if mode == "down" then -- key down 82 90 self:moveSelectionRow(1) 83 elseif code == "200" then -- key up91 elseif mode == "up" then -- key up 84 92 self:moveSelectionRow(-1) 85 elseif code == "205" then -- key right93 elseif mode == "right" then -- key right 86 94 self:moveSelectionColumn(1) 87 elseif code == "203" then -- key left95 elseif mode == "left" then -- key left 88 96 self:moveSelectionColumn(-1) 89 elseif code == "28" then -- keyenter97 elseif mode == "enter" then -- key enter or key numpad enter 90 98 self:pressSelectedButton() 91 99 end 92 100 end 93 101 94 self .onKeyPressed()95 end 96 97 -- Override this function if you want to ract on keystrokes 98 function P:onKeyPressed()102 self:onKeyPressed(mode) 103 end 104 105 function P:windowResized() 106 self:onWindowResized() 99 107 end 100 108
Note: See TracChangeset
for help on using the changeset viewer.