Changeset 6422 for code/trunk/src/libraries/core/input
- Timestamp:
- Dec 26, 2009, 11:18:13 AM (15 years ago)
- Location:
- code/trunk/src/libraries/core/input
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/input/InputManager.cc
r6417 r6422 404 404 { 405 405 // Get smallest possible priority between 1 and maxStateStackSize_s 406 for (std::map<int, InputState*>::reverse_iterator rit = activeStates_.rbegin();406 for (std::map<int, InputState*>::reverse_iterator rit = activeStates_.rbegin(); 407 407 rit != activeStates_.rend(); ++rit) 408 408 { -
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]; -
code/trunk/src/libraries/core/input/Keyboard.cc
r6417 r6422 36 36 { 37 37 // update modifiers 38 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU)38 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU) 39 39 modifiers_ |= KeyboardModifier::Alt; // alt key 40 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)40 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL) 41 41 modifiers_ |= KeyboardModifier::Ctrl; // ctrl key 42 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT)42 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT) 43 43 modifiers_ |= KeyboardModifier::Shift; // shift key 44 44 … … 56 56 { 57 57 // update modifiers 58 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU)58 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU) 59 59 modifiers_ &= ~KeyboardModifier::Alt; // alt key 60 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)60 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL) 61 61 modifiers_ &= ~KeyboardModifier::Ctrl; // ctrl key 62 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT)62 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT) 63 63 modifiers_ &= ~KeyboardModifier::Shift; // shift key 64 64
Note: See TracChangeset
for help on using the changeset viewer.