Changeset 1638 for code/branches/gui/src/core/input/KeyDetector.cc
- Timestamp:
- Jul 20, 2008, 7:49:26 PM (16 years ago)
- Location:
- code/branches/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui
-
Property
svn:mergeinfo
set to
/code/branches/input merged eligible
-
Property
svn:mergeinfo
set to
-
code/branches/gui/src/core/input/KeyDetector.cc
r1535 r1638 28 28 29 29 /** 30 @file 31 @brief Implementation of the different input handlers. 32 */ 30 @file 31 @brief 32 Implementation of the different input handlers. 33 */ 33 34 34 35 #include "KeyDetector.h" … … 42 43 namespace orxonox 43 44 { 44 /** 45 @brief Constructor 46 */ 47 KeyDetector::KeyDetector() 48 { 49 RegisterObject(KeyDetector); 50 } 45 /** 46 @brief 47 Constructor 48 */ 49 KeyDetector::KeyDetector() 50 { 51 RegisterObject(KeyDetector); 52 } 51 53 52 /** 53 @brief Destructor 54 */ 55 KeyDetector::~KeyDetector() 56 { 57 } 54 /** 55 @brief 56 Destructor 57 */ 58 KeyDetector::~KeyDetector() 59 { 60 } 58 61 59 /** 60 @brief Loads the key and button bindings. 61 @return True if loading succeeded. 62 */ 63 void KeyDetector::loadBindings() 64 { 65 clearBindings(); 66 setConfigValues(); 67 } 62 /** 63 @brief 64 Loads the key and button bindings. 65 @return 66 True if loading succeeded. 67 */ 68 void KeyDetector::loadBindings(const std::string& command) 69 { 70 clearBindings(); 71 setConfigValues(); 72 this->command_ = command; 73 } 68 74 69 void KeyDetector::readTrigger(Button& button)70 {71 SimpleCommand* cmd = new SimpleCommand();72 cmd->evaluation_ = CommandExecutor::evaluate("storeKeyStroke" + button.name_);73 button.commands_[KeybindMode::OnPress] = new BaseCommand*[1];74 button.commands_[KeybindMode::OnPress][0] = cmd;75 button.nCommands_[KeybindMode::OnPress] = 1;76 }75 void KeyDetector::readTrigger(Button& button) 76 { 77 SimpleCommand* cmd = new SimpleCommand(); 78 cmd->evaluation_ = CommandExecutor::evaluate(this->command_ + " " + button.name_); 79 button.commands_[KeybindMode::OnPress] = new BaseCommand*[1]; 80 button.commands_[KeybindMode::OnPress][0] = cmd; 81 button.nCommands_[KeybindMode::OnPress] = 1; 82 } 77 83 }
Note: See TracChangeset
for help on using the changeset viewer.