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/Button.h

    r1755 r1887  
    4040#include <string>
    4141#include <vector>
     42#include "InputCommands.h"
    4243
    4344namespace orxonox
     
    4647    {
    4748    public:
    48         Button() { nCommands_[0]=0; nCommands_[1]=0; nCommands_[2]=0; clear(); }
     49        Button();
    4950        virtual ~Button() { clear(); }
    5051        virtual void clear();
    5152        virtual bool addParamCommand(ParamCommand* command) { return false; }
    52         void parse(std::vector<BufferedParamCommand*>& paramCommandBuffer);
     53        void parse();
     54        void readConfigValue();
    5355        bool execute(KeybindMode::Enum mode, float abs = 1.0f, float rel = 1.0f);
    5456
     57        //! Container to allow for better configValue support
     58        ConfigValueContainer* configContainer_;
    5559        //! The configured string value
    5660        std::string bindingString_;
    5761        //! Name of the trigger as strings
    5862        std::string name_;
     63        //! Name of the group of input triggers
     64        std::string groupName_;
    5965        //! Basic commands for OnPress, OnHold and OnRelease
    6066        BaseCommand** commands_[3];
     
    6470        //! Note: This variable is here to have only one parse() function.
    6571        float buttonThreshold_;
     72        bool bButtonThresholdUser_;
     73        //! Pointer to the list of parametrised commands
     74        std::vector<BufferedParamCommand*>* paramCommandBuffer_;
    6675
    6776    private:
    6877        void parseError(std::string message, bool serious);
    6978    };
     79
     80    inline bool Button::execute(KeybindMode::Enum mode, float abs, float rel)
     81    {
     82        // execute all the parsed commands in the string
     83        for (unsigned int iCommand = 0; iCommand < nCommands_[mode]; iCommand++)
     84            commands_[mode][iCommand]->execute(abs, rel);
     85        return true;
     86    }
     87
    7088}
    7189
Note: See TracChangeset for help on using the changeset viewer.