Changeset 934 for code/branches/network/src/orxonox/InputHandler.h
- Timestamp:
- Mar 27, 2008, 5:15:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/InputHandler.h
r929 r934 43 43 namespace orxonox 44 44 { 45 /** 46 @brief Captures and distributes mouse and keyboard input. 47 It resolves the key bindings to InputEvents which can be heard by 48 implementing the InputEventListener interface. 49 */ 45 50 class _OrxonoxExport InputHandler 46 51 : public Tickable, public OIS::KeyListener, public OIS::MouseListener 47 52 { 48 //friend ClassIdentifier<InputHandler>;53 //friend class ClassIdentifier<InputHandler>; 49 54 public: 50 voidinitialise(size_t windowHnd, int windowWidth, int windowHeight);51 void destroy ();55 bool initialise(size_t windowHnd, int windowWidth, int windowHeight); 56 void destroyDevices(); 52 57 void tick(float dt); 53 58 void setWindowExtents(int width, int height); 54 59 60 // Temporary solutions. Will be removed soon! 55 61 OIS::Mouse *getMouse() { return this->mouse_ ; } 56 62 OIS::Keyboard *getKeyboard() { return this->keyboard_; } 57 63 58 64 static InputHandler* getSingleton(); 65 static void destroy(); 59 66 60 67 private: … … 78 85 OIS::Mouse *mouse_; //!< OIS keyboard 79 86 80 /** 81 @bref Tells whether initialise has been called successfully 82 Also true if destroy() has been called. 83 */ 84 bool uninitialized_; 85 86 //! denotes the maximum number of different keys there are in OIS. 87 //! 256 should be ok since the highest number in the enum is 237. 87 /** denotes the maximum number of different keys there are in OIS. 88 256 should be ok since the highest number in the enum is 237. */ 88 89 static const int numberOfKeys_ = 256; 89 90 //! Array of input events for every pressed key … … 92 93 InputEvent bindingsKeyReleased_[numberOfKeys_]; 93 94 94 / /!denotes the maximum number of different buttons there are in OIS.95 //! 16 should be ok since the highest number in the enum is 7.95 /** denotes the maximum number of different buttons there are in OIS. 96 16 should be ok since the highest number in the enum is 7. */ 96 97 static const int numberOfButtons_ = 16; 97 98 //! Array of input events for every pressed key … … 100 101 InputEvent bindingsButtonReleased_[numberOfButtons_]; 101 102 103 //! Pointer to the instance of the singleton 104 static InputHandler *singletonRef_s; 102 105 }; 103 106 }
Note: See TracChangeset
for help on using the changeset viewer.