Changeset 955 for code/branches/core2/src/orxonox/Orxonox.cc
- Timestamp:
- Mar 30, 2008, 12:12:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/Orxonox.cc
r874 r955 86 86 #include "objects/test3.h" 87 87 88 #include "core/CommandExecutor.h" 89 #include "core/InputBuffer.h" 90 88 91 #include "Orxonox.h" 89 92 90 93 namespace orxonox 91 94 { 95 class Testlistener : public InputBufferListener 96 { 97 public: 98 Testlistener(InputBuffer* ib) : ib_(ib) {} 99 void listen() const 100 { 101 std::cout << "> -->" << this->ib_->get() << "<--" << std::endl; 102 } 103 void execute() const 104 { 105 std::cout << "### EXECUTE!" << std::endl; 106 CommandExecutor::execute(this->ib_->get()); 107 this->ib_->clear(); 108 } 109 void hintandcomplete() const 110 { 111 std::cout << "### HINT!" << std::endl; 112 std::cout << CommandExecutor::hint(this->ib_->get()) << std::endl; 113 this->ib_->set(CommandExecutor::complete(this->ib_->get())); 114 } 115 void clear() const 116 { 117 std::cout << "### CLEAR!" << std::endl; 118 this->ib_->clear(); 119 } 120 void removeLast() const 121 { 122 std::cout << "### REMOVELAST!" << std::endl; 123 this->ib_->removeLast(); 124 } 125 126 private: 127 InputBuffer* ib_; 128 }; 129 92 130 // put this in a seperate Class or solve the problem in another fashion 93 131 class OrxListener : public Ogre::FrameListener … … 1146 1184 std::cout << "2\n"; 1147 1185 */ 1186 InputBuffer* ib = new InputBuffer(this->getKeyboard()); 1187 Testlistener* testlistener = new Testlistener(ib); 1188 ib->registerListener(testlistener, &Testlistener::listen, true); 1189 ib->registerListener(testlistener, &Testlistener::execute, '\r', false); 1190 ib->registerListener(testlistener, &Testlistener::hintandcomplete, '\t', true); 1191 ib->registerListener(testlistener, &Testlistener::clear, '§', true); 1192 ib->registerListener(testlistener, &Testlistener::removeLast, '\b', true); 1193 1148 1194 startRenderLoop(); 1149 1195 } … … 1364 1410 try 1365 1411 { 1366 keyboard_ = static_cast<OIS::Keyboard*>(inputManager_->createInputObject(OIS::OISKeyboard, false));1412 keyboard_ = static_cast<OIS::Keyboard*>(inputManager_->createInputObject(OIS::OISKeyboard, true)); 1367 1413 mouse_ = static_cast<OIS::Mouse*>(inputManager_->createInputObject(OIS::OISMouse, true)); 1368 1414 }
Note: See TracChangeset
for help on using the changeset viewer.