- Timestamp:
- Dec 2, 2009, 8:41:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/input/KeyBinder.cc
r6155 r6214 254 254 // Parse bindings and create the ConfigValueContainers if necessary 255 255 for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it) 256 { 256 257 it->second->readConfigValue(this->configFile_); 258 this->allCommands_[it->second->bindingString_] = it->second->groupName_ + " " + it->second->name_; 259 } 257 260 258 261 COUT(3) << "KeyBinder: Loading key bindings done." << std::endl; … … 269 272 it->second->configContainer_->set(binding); 270 273 it->second->configContainer_->getValue(&(it->second->bindingString_), it->second); 274 this->allCommands_[it->second->bindingString_] = it->second->groupName_ + " " + it->second->name_; 271 275 return true; 272 276 } … … 276 280 return false; 277 281 } 282 } 283 284 /** 285 @brief 286 Return the key name for a specific command 287 */ 288 std::string KeyBinder::getBinding(std::string commandName) 289 { 290 COUT(0)<< commandName << endl; 291 if( this->allCommands_.find(commandName) != this->allCommands_.end()) 292 { 293 std::string keyname = this->allCommands_[commandName]; 294 // while(keyname.find(".")!=keyname.npos) 295 // keyname.replace(1, keyname.find("."), " "); 296 COUT(0) << keyname << endl; 297 return keyname; 298 } 299 else 300 return ""; 278 301 } 279 302
Note: See TracChangeset
for help on using the changeset viewer.