Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 20, 2008, 6:49:24 PM (16 years ago)
Author:
rgrieder
Message:

Finally! The InputManager is now working like I imagined it to. And it's even easier to use it as well.
A little explanation: Every time you change something about the input distribution, it is a change of 'state' represented by the class 'InputState'.
That can be for instance: "console", "game", "gui", etc. Every state has a name and a priority which describes who comes first. Now if one state doesn't handle mouse input or instance, then the one with the next lower priority gets it. To prevent that, you can add the 'EmptyHandler' to the state with setMouseHandler.
InputState is just an abstract base class. There are two classes implementing it: SimpleInputState and ExtendedInputState. The latter allows for multiple input handlers for one single device.

Basically, what you need to know is what you see in Orxonox.cc, InGameConsole.cc and Shell.cc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/core/input/KeyDetector.cc

    r1630 r1637  
    6666        True if loading succeeded.
    6767    */
    68     void KeyDetector::loadBindings()
     68    void KeyDetector::loadBindings(const std::string& command)
    6969    {
    7070        clearBindings();
    7171        setConfigValues();
     72        this->command_ = command;
    7273    }
    7374
     
    7576    {
    7677        SimpleCommand* cmd = new SimpleCommand();
    77         cmd->evaluation_ = CommandExecutor::evaluate("storeKeyStroke " + button.name_);
     78        cmd->evaluation_ = CommandExecutor::evaluate(this->command_ + " " + button.name_);
    7879        button.commands_[KeybindMode::OnPress] = new BaseCommand*[1];
    7980        button.commands_[KeybindMode::OnPress][0] = cmd;
Note: See TracChangeset for help on using the changeset viewer.