Changeset 1887 for code/trunk/src/core/input/KeyDetector.cc
- Timestamp:
- Oct 6, 2008, 12:31:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/input/KeyDetector.cc
r1755 r1887 62 62 /** 63 63 @brief 64 Loads the key and button bindings. 65 @return 66 True if loading succeeded. 64 Assigns all the buttons 'command' plus the button's name. 67 65 */ 68 void KeyDetector:: loadBindings(const std::string& command)66 void KeyDetector::setCallbackCommand(const std::string& command) 69 67 { 70 this->command_ = command;68 callbackCommand_ = command; 71 69 clearBindings(); 72 setConfigValues(); 70 for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it) 71 { 72 it->second->bindingString_ = callbackCommand_ + it->second->name_; 73 it->second->parse(); 74 } 73 75 } 74 76 75 void KeyDetector:: readTrigger(Button& button)77 void KeyDetector::JoyStickDeviceNumberChanged(unsigned int value) 76 78 { 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; 79 KeyBinder::JoyStickDeviceNumberChanged(value); 80 setCallbackCommand(callbackCommand_); 82 81 } 83 82 }
Note: See TracChangeset
for help on using the changeset viewer.