Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 6, 2011, 4:32:05 PM (13 years ago)
Author:
dafrick
Message:

Replacing hard coded keys for the menu navigation with keys specified in the keybindings.ini file (note: You have to delete your keybindings.ini file for it to be regenerated and work correctly).
The upside is, that now we need less hackish, stuff, it's better integrated, toggling of OrxonoxOverlays (e.g. QuestGUI and PickupInventory, among others) is working again. Closing the InGameConsole with ESC no longer requires a workaround to work.
The downside is, that now GUI sheets that require input, e.g. GraphicsMenu or MiscConfigMenu, no longer support menu navigation and ESC doesn't work there. However, I don't know how to work around that, yet. But since all that ESC business is a hack anyway, I'd rather have the hacks there…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/data/gui/scripts/GUISheet.lua

    r8028 r8035  
    2929
    3030-- Override this function if you want to react on keystrokes
    31 function P:onKeyPressed()
     31function P:onKeyPressed(mode)
    3232end
    3333
     
    8585
    8686-- Handles key pressed while the gui sheed is displayed
    87 function P:keyPressed()
     87function P:keyPressed(mode)
    8888    if self.buttons then
    89         if code == "208" then     -- key down
     89        if mode == "down" then     -- key down
    9090            self:moveSelectionRow(1)
    91         elseif code == "200" then -- key up
     91        elseif mode == "up" then -- key up
    9292            self:moveSelectionRow(-1)
    93         elseif code == "205" then -- key right
     93        elseif mode == "right" then -- key right
    9494            self:moveSelectionColumn(1)
    95         elseif code == "203" then -- key left
     95        elseif mode == "left" then -- key left
    9696            self:moveSelectionColumn(-1)
    97         elseif code == "28" or code == "156" then -- key enter or key numpad enter
     97        elseif mode == "enter" then -- key enter or key numpad enter
    9898            self:pressSelectedButton()
    9999        end
    100100    end
    101101
    102     self:onKeyPressed()
     102    self:onKeyPressed(mode)
    103103end
    104104
Note: See TracChangeset for help on using the changeset viewer.