Changeset 7198 for code/branches/consolecommands3/src/libraries/core/input
- Timestamp:
- Aug 21, 2010, 9:52:13 PM (14 years ago)
- Location:
- code/branches/consolecommands3/src/libraries/core/input
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/input/InputState.h
r6746 r7198 150 150 void left(); 151 151 //! Sets a functor to be called upon activation of the state 152 void setEnterFunctor( Functor*functor) { this->enterFunctor_ = functor; }152 void setEnterFunctor(const FunctorPtr& functor) { this->enterFunctor_ = functor; } 153 153 //! Sets a functor to be called upon deactivation of the state 154 void setLeaveFunctor( Functor*functor) { this->leaveFunctor_ = functor; }154 void setLeaveFunctor(const FunctorPtr& functor) { this->leaveFunctor_ = functor; } 155 155 156 156 private: … … 172 172 //! Handler to be used for all joy sticks (needs to be saved in case another joy stick gets attached) 173 173 InputHandler* joyStickHandlerAll_; 174 Functor *enterFunctor_; //!< Functor to be executed on enter175 Functor *leaveFunctor_; //!< Functor to be executed on leave174 FunctorPtr enterFunctor_; //!< Functor to be executed on enter 175 FunctorPtr leaveFunctor_; //!< Functor to be executed on leave 176 176 }; 177 177 -
code/branches/consolecommands3/src/libraries/core/input/KeyBinderManager.cc
r6417 r7198 156 156 { 157 157 COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl; 158 KeyDetector::getInstance().setCallback( shared_ptr<Functor>(createFunctor(&KeyBinderManager::keybindKeyPressed, this)));158 KeyDetector::getInstance().setCallback(createFunctor(&KeyBinderManager::keybindKeyPressed, this)); 159 159 InputManager::getInstance().enterState("detector"); 160 160 this->command_ = command; -
code/branches/consolecommands3/src/libraries/core/input/KeyBinderManager.h
r6417 r7198 99 99 void unbind(const std::string& binding); //tolua_export 100 100 void tunbind(const std::string& binding); 101 inline void registerKeybindCallback( Functor* function) { this->callbackFunction_.reset(function); } // tolua_export101 inline void registerKeybindCallback(const FunctorPtr& function) { this->callbackFunction_ = function; } // tolua//_//export // <-- FIXME 102 102 103 103 private: … … 114 114 115 115 // keybind command related 116 shared_ptr<Functor> callbackFunction_;//! Function to be called when key was pressed after "keybind" command116 FunctorPtr callbackFunction_; //! Function to be called when key was pressed after "keybind" command 117 117 bool bBinding_; //! Tells whether a key binding process is active 118 118 bool bTemporary_; //! Stores tkeybind/keybind value -
code/branches/consolecommands3/src/libraries/core/input/KeyDetector.h
r6417 r7198 46 46 ~KeyDetector(); 47 47 48 void setCallback(const shared_ptr<Functor>& function) { this->callbackFunction_ = function; }48 void setCallback(const FunctorPtr& function) { this->callbackFunction_ = function; } 49 49 50 50 private: … … 55 55 void assignCommands(); 56 56 57 shared_ptr<Functor>callbackFunction_;57 FunctorPtr callbackFunction_; 58 58 InputState* inputState_; 59 59 static std::string callbackCommand_s;
Note: See TracChangeset
for help on using the changeset viewer.