Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 12, 2011, 11:54:07 AM (13 years ago)
Author:
landauf
Message:

added function to KeyBinder which allows to change the keybind mode (OnPress, OnRelease, OnHold) of a command which is bound to a key.
enhanced ConsoleCommand (+Manipulator) to use this feature.

input system experts, please review :D

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/input/InputCommands.h

    r7284 r7861  
    5858        virtual ~BaseCommand() { }
    5959        virtual bool execute(float abs = 1.0f, float rel = 1.0f) = 0;
     60        virtual CommandEvaluation* getEvaluation() = 0;
    6061    };
    6162
     
    6465    public:
    6566        bool execute(float abs = 1.0f, float rel = 1.0f);
     67        CommandEvaluation* getEvaluation();
    6668
    6769        CommandEvaluation evaluation_;
     
    7981    }
    8082
     83    /// Returns a pointer to the encapsuled evaluation.
     84    inline CommandEvaluation* SimpleCommand::getEvaluation()
     85    {
     86        return &this->evaluation_;
     87    }
     88
    8189    class _CoreExport ParamCommand : public BaseCommand
    8290    {
     
    8492        ParamCommand() : scale_(1.0f), paramCommand_(0) { }
    8593        bool execute(float abs = 1.0f, float rel = 1.0f);
     94        CommandEvaluation* getEvaluation();
    8695
    8796        float scale_;
    8897        BufferedParamCommand* paramCommand_;
    8998    };
     99
     100    /// Returns a pointer to the encapsuled evaluation.
     101    inline CommandEvaluation* ParamCommand::getEvaluation()
     102    {
     103        if (this->paramCommand_)
     104            return &this->paramCommand_->evaluation_;
     105        else
     106            return 0;
     107    }
    90108}
    91109
Note: See TracChangeset for help on using the changeset viewer.