Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 6, 2008, 12:31:32 AM (16 years ago)
Author:
rgrieder
Message:

FIRST THINGS FIRST: Delete or rename your keybindings.ini (def_keybindings.ini already has the most important bindings) or else you won't be able to do anything!

Changes:

  • Multiple joy stick support should now fully work with KeyBinder too (only tested with 0/1 joystick)
  • Reloading the OIS Devices now works with KeyBinder too
  • Modified ConfigValueContainer to accept arbitrary section names
  • added tkeybind to temporary bind a command to a key
  • Fixed dlleport issue in ArgumentCompletionFunctions.h

Internal changes:

  • General cleanup in initialisation of KeyBinder
  • All names of keys/buttons/axes are now statically saved in InputInterfaces.h
  • Move a magic value in KeyBinder to a configValue (MouseWheelStepSize_)
  • Separated ConfigValues from Keybinding ConfigValueContainer in KeyBinder (looks much nicer now ;))
  • Moved some performance critical small function to the inline section
  • Removed the ugly keybind function construct from the InputManager
  • More 'harmonising' work in KeyBinder
File:
1 edited

Legend:

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

    r1755 r1887  
    6262    /**
    6363    @brief
    64         Loads the key and button bindings.
    65     @return
    66         True if loading succeeded.
     64        Assigns all the buttons 'command' plus the button's name.
    6765    */
    68     void KeyDetector::loadBindings(const std::string& command)
     66    void KeyDetector::setCallbackCommand(const std::string& command)
    6967    {
    70         this->command_ = command;
     68        callbackCommand_ = command;
    7169        clearBindings();
    72         setConfigValues();
     70        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
     71        {
     72            it->second->bindingString_ = callbackCommand_ + it->second->name_;
     73            it->second->parse();
     74        }
    7375    }
    7476
    75     void KeyDetector::readTrigger(Button& button)
     77    void KeyDetector::JoyStickDeviceNumberChanged(unsigned int value)
    7678    {
    77         SimpleCommand* cmd = new SimpleCommand();
    78         cmd->evaluation_ = CommandExecutor::evaluate(this->command_ + " " + button.name_);
    79         button.commands_[KeybindMode::OnPress] = new BaseCommand*[1];
    80         button.commands_[KeybindMode::OnPress][0] = cmd;
    81         button.nCommands_[KeybindMode::OnPress] = 1;
     79        KeyBinder::JoyStickDeviceNumberChanged(value);
     80        setCallbackCommand(callbackCommand_);
    8281    }
    8382}
Note: See TracChangeset for help on using the changeset viewer.