- Timestamp:
- Dec 9, 2009, 12:43:12 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc
r6266 r6281 29 29 #include "KeyBinderManager.h" 30 30 31 #include <CEGUIWindow.h> 32 31 33 #include "util/Debug.h" 32 34 #include "util/Exception.h" … … 37 39 #include "InputManager.h" 38 40 #include "KeyDetector.h" 39 40 #include <CEGUIWindow.h>41 41 42 42 namespace orxonox … … 49 49 , bBinding_(false) 50 50 { 51 this->callbackFunction_ = createFunctor(&KeyBinderManager::callback, this);52 53 51 RegisterObject(KeyBinderManager); 54 52 this->setConfigValues(); … … 69 67 for (std::map<std::string, KeyBinder*>::const_iterator it = this->binders_.begin(); it != this->binders_.end(); ++it) 70 68 delete it->second; 71 delete this->callbackFunction_;72 69 } 73 70 … … 152 149 { 153 150 COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl; 154 KeyDetector::getInstance().setCallback( callbackFunction_);151 KeyDetector::getInstance().setCallback(shared_ptr<Functor>(createFunctor(&KeyBinderManager::keybindKeyPressed, this))); 155 152 InputManager::getInstance().enterState("detector"); 156 153 this->command_ = command; … … 162 159 163 160 // Gets called by the KeyDetector (registered with a Functor) 164 void KeyBinderManager:: callback(const std::string& keyName)161 void KeyBinderManager::keybindKeyPressed(const std::string& keyName) 165 162 { 166 163 if (this->bBinding_) … … 169 166 this->currentBinder_->setBinding(command_, keyName, bTemporary_); 170 167 InputManager::getInstance().leaveState("detector"); 168 // inform whatever was calling the command 169 if (this->callbackFunction_) 170 (*this->callbackFunction_)(); 171 171 this->bBinding_ = false; 172 172 }
Note: See TracChangeset
for help on using the changeset viewer.