- Timestamp:
- Oct 4, 2009, 12:26:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/input/KeyDetector.cc
r5864 r5869 31 31 #include "core/ConsoleCommand.h" 32 32 #include "core/CoreIncludes.h" 33 #include "core/ScopedSingletonManager.h" 33 34 #include "Button.h" 35 #include "InputManager.h" 36 #include "InputState.h" 34 37 35 38 namespace orxonox … … 37 40 std::string KeyDetector::callbackCommand_s = "KeyDetectorKeyPressed"; 38 41 KeyDetector* KeyDetector::singletonPtr_s = 0; 42 ManageScopedSingleton(KeyDetector, ScopeID::Graphics); 39 43 40 44 KeyDetector::KeyDetector() … … 45 49 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&KeyDetector::callback, this), callbackCommand_s)); 46 50 this->assignCommands(); 51 52 inputState_ = InputManager::getInstance().createInputState("detector", false, false, InputStatePriority::Detector); 53 // Create a callback to avoid buttonHeld events after the key has been detected 54 inputState_->setLeaveFunctor(createFunctor(&InputManager::clearBuffers, &InputManager::getInstance())); 55 inputState_->setHandler(this); 56 } 57 58 KeyDetector::~KeyDetector() 59 { 60 inputState_->setHandler(NULL); 61 InputManager::getInstance().destroyState("detector"); 47 62 } 48 63
Note: See TracChangeset
for help on using the changeset viewer.