- Timestamp:
- Apr 14, 2008, 10:50:08 PM (17 years ago)
- Location:
- code/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/InputBuffer.cc
r1062 r1066 38 38 InputBuffer::InputBuffer() 39 39 { 40 this->bActivated_ = false;40 //this->bActivated_ = false; 41 41 this->allowedChars_ = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZäöüÄÖÜ0123456789 \\\"().:,;_-+*/=!?<>[|]"; 42 42 this->keyboard_ = InputManager::getSingleton().getKeyboard(); 43 43 this->buffer_ = ""; 44 44 45 this->keyboard_->setEventCallback(this);45 //this->keyboard_->setEventCallback(this); 46 46 } 47 47 /* … … 114 114 } 115 115 116 void InputBuffer::activityChanged() const116 /*void InputBuffer::activityChanged() const 117 117 { 118 } 118 }*/ 119 119 120 120 bool InputBuffer::charIsAllowed(const char& input) … … 128 128 bool InputBuffer::keyPressed(const OIS::KeyEvent &e) 129 129 { 130 if (e.key == OIS::KC_NUMPADENTER)130 /*if (e.key == OIS::KC_NUMPADENTER) 131 131 { 132 132 this->setActivated(!this->isActivated()); 133 133 this->clear(); 134 134 return true; 135 } 135 }*/ 136 136 137 137 if (this->keyboard_->isModifierDown(OIS::Keyboard::Ctrl)) … … 169 169 } 170 170 171 if (this->bActivated_) 172 { 173 //std::cout << this->keyboard_->getAsString(e.key) << " / " << (char)e.text << std::endl; 174 /* 175 std::string input = this->keyboard_->getAsString(e.key); 176 if (input.size() >= 1) 177 this->append(input[0]); 178 */ 179 this->append((char)e.text); 180 } 171 //std::cout << this->keyboard_->getAsString(e.key) << " / " << (char)e.text << std::endl; 172 173 std::string input = this->keyboard_->getAsString(e.key); 174 /*if (input.size() >= 1) 175 this->append(input[0]);*/ 176 177 this->append((char)e.text); 181 178 return true; 182 179 } -
code/trunk/src/core/InputBuffer.h
r1062 r1066 44 44 { 45 45 class _CoreExport InputBufferListener 46 { 47 }; 46 {}; 48 47 49 48 class _CoreExport InputBuffer : public OIS::KeyListener … … 99 98 { return this->buffer_; } 100 99 101 inline void activate()100 /*inline void activate() 102 101 { this->setActivated(true); } 103 102 inline void deactivate() … … 108 107 { return this->bActivated_; } 109 108 110 void activityChanged() const; 109 void activityChanged() const;*/ 111 110 112 111 private: … … 117 116 118 117 OIS::Keyboard* keyboard_; 119 bool bActivated_;118 //bool bActivated_; 120 119 std::string buffer_; 121 120 std::list<InputBufferListenerTuple> listeners_; -
code/trunk/src/core/InputHandler.cc
r1062 r1066 37 37 #include "InputEventListener.h" 38 38 #include "InputEvent.h" 39 #include "InputManager.h" 39 40 40 41 namespace orxonox … … 83 84 InputEvent e = {1, true, 0, 0, 0}; 84 85 InputHandlerGame::callListeners(e); 86 } 87 else if (e.key == OIS::KC_NUMPADENTER) 88 { 89 InputManager::getSingleton().setInputMode(IM_KEYBOARD); 85 90 } 86 91 else -
code/trunk/src/core/InputManager.cc
r1062 r1066 38 38 #include "InputEventListener.h" 39 39 #include "InputHandler.h" 40 #include "InputBuffer.h" 40 41 41 42 namespace orxonox 42 43 { 43 /**44 @brief The reference to the singleton45 */46 //InputManager* InputManager::singletonRef_s = 0;47 48 44 /** 49 45 @brief Constructor only resets the pointer values to 0. … … 126 122 this->handlerGUI_ = new InputHandlerGUI(); 127 123 this->handlerGame_ = new InputHandlerGame(); 124 //this->handlerBuffer_ = new InputBuffer(); 128 125 this->handlerGame_->loadBindings(); 129 126 … … 244 241 } 245 242 243 void InputManager::feedInputBuffer(InputBuffer* buffer) 244 { 245 this->handlerBuffer_ = buffer; 246 } 247 248 246 249 } -
code/trunk/src/core/InputManager.h
r1062 r1066 75 75 InputMode getInputMode(); 76 76 77 // temporary hack 78 void feedInputBuffer(InputBuffer* buffer); 79 77 80 // Temporary solutions. Will be removed soon! 78 81 OIS::Mouse *getMouse() { return this->mouse_ ; } … … 96 99 InputHandlerGUI *handlerGUI_; //!< Handles the input if in GUI mode 97 100 // FIXME: insert the InputBuffer once merged with core2 98 Input HandlerGUI*handlerBuffer_; //!< Handles the input if in Buffer mode101 InputBuffer *handlerBuffer_; //!< Handles the input if in Buffer mode 99 102 InputHandlerGame *handlerGame_; //!< Handles the input if in Game mode 100 103 -
code/trunk/src/orxonox/Orxonox.cc
r1062 r1066 397 397 { 398 398 InputBuffer* ib = new InputBuffer(); 399 InputManager::getSingleton().feedInputBuffer(ib); 399 400 Testconsole* console = new Testconsole(ib); 400 401 ib->registerListener(console, &Testconsole::listen, true); 401 402 ib->registerListener(console, &Testconsole::execute, '\r', false); 403 ib->registerListener(console, &Testconsole::execute, '\n', false); 402 404 ib->registerListener(console, &Testconsole::hintandcomplete, '\t', true); 403 405 ib->registerListener(console, &Testconsole::clear, '§', true);
Note: See TracChangeset
for help on using the changeset viewer.