Changeset 8027 for code/branches/usability/src/libraries
- Timestamp:
- Mar 6, 2011, 1:16:56 AM (14 years ago)
- Location:
- code/branches/usability/src/libraries/core/input
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/src/libraries/core/input/InputBuffer.cc
r6417 r8027 47 47 \\\"(){}[]<>.:,;_-+*/=!?|$&%^~#"; 48 48 49 this->keyTranslator_[KeyCode::Numpad0] = '0'; 50 this->keyTranslator_[KeyCode::Numpad1] = '1'; 51 this->keyTranslator_[KeyCode::Numpad2] = '2'; 52 this->keyTranslator_[KeyCode::Numpad3] = '3'; 53 this->keyTranslator_[KeyCode::Numpad4] = '4'; 54 this->keyTranslator_[KeyCode::Numpad5] = '5'; 55 this->keyTranslator_[KeyCode::Numpad6] = '6'; 56 this->keyTranslator_[KeyCode::Numpad7] = '7'; 57 this->keyTranslator_[KeyCode::Numpad8] = '8'; 58 this->keyTranslator_[KeyCode::Numpad9] = '9'; 59 this->keyTranslator_[KeyCode::NumpadPeriod] = '.'; 60 this->keyTranslator_[KeyCode::Divide] = '/'; 61 this->keyTranslator_[KeyCode::NumpadEnter] = '\n'; 62 49 63 this->lastKey_ = KeyCode::Unassigned; 50 64 this->timeSinceKeyPressed_ = 0.0f; … … 228 242 } 229 243 230 this->insert(static_cast<char>(evt.getText())); 244 std::map<KeyCode::ByEnum, char>::iterator it = this->keyTranslator_.find(evt.getKeyCode()); 245 if (it != this->keyTranslator_.end()) 246 this->insert(it->second); 247 else 248 this->insert(static_cast<char>(evt.getText())); 231 249 } 232 250 -
code/branches/usability/src/libraries/core/input/InputBuffer.h
r6417 r8027 178 178 std::list<BaseInputBufferListenerTuple*> listeners_; 179 179 std::string allowedChars_; 180 std::map<KeyCode::ByEnum, char> keyTranslator_; 180 181 unsigned int maxLength_; 181 182 unsigned int cursor_;
Note: See TracChangeset
for help on using the changeset viewer.