Changeset 6422 for code/trunk/src/libraries/core/input/KeyBinder.cc
- Timestamp:
- Dec 26, 2009, 11:18:13 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/input/KeyBinder.cc
r6417 r6422 291 291 std::vector<std::string>& oldKeynames = this->allCommands_[button->bindingString_]; 292 292 std::vector<std::string>::iterator it = std::find(oldKeynames.begin(), oldKeynames.end(), stream.str()); 293 if(it != oldKeynames.end()) 294 { 293 if (it != oldKeynames.end()) 295 294 oldKeynames.erase(it); 296 }297 295 298 296 if (!command.empty()) 299 297 { 300 298 std::vector<std::string>& keynames = this->allCommands_[command]; 301 if( std::find(keynames.begin(), keynames.end(), stream.str()) == keynames.end()) 302 { 299 if (std::find(keynames.begin(), keynames.end(), stream.str()) == keynames.end()) 303 300 this->allCommands_[command].push_back(stream.str()); 304 }305 301 } 306 302 } … … 312 308 const std::string& KeyBinder::getBinding(const std::string& commandName) 313 309 { 314 if (this->allCommands_.find(commandName) != this->allCommands_.end())310 if (this->allCommands_.find(commandName) != this->allCommands_.end()) 315 311 { 316 312 std::vector<std::string>& keynames = this->allCommands_[commandName]; … … 331 327 const std::string& KeyBinder::getBinding(const std::string& commandName, unsigned int index) 332 328 { 333 if (this->allCommands_.find(commandName) != this->allCommands_.end())329 if (this->allCommands_.find(commandName) != this->allCommands_.end()) 334 330 { 335 331 std::vector<std::string>& keynames = this->allCommands_[commandName]; 336 if(index < keynames.size()) 337 { 332 if (index < keynames.size()) 338 333 return keynames[index]; 339 }340 334 341 335 return BLANKSTRING; … … 353 347 unsigned int KeyBinder::getNumberOfBindings(const std::string& commandName) 354 348 { 355 if (this->allCommands_.find(commandName) != this->allCommands_.end())349 if (this->allCommands_.find(commandName) != this->allCommands_.end()) 356 350 { 357 351 std::vector<std::string>& keynames = this->allCommands_[commandName];
Note: See TracChangeset
for help on using the changeset viewer.