Changeset 1182 for code/branches/input/src/core/InputHandler.h
- Timestamp:
- Apr 24, 2008, 9:40:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/core/InputHandler.h
r1062 r1182 38 38 39 39 #include <string> 40 #include <list> 40 41 #include <OIS/OIS.h> 41 42 … … 44 45 namespace orxonox 45 46 { 47 namespace KeybindSetting 48 { 49 enum KeybindSetting 50 { 51 None, 52 OnPress, 53 OnRelease, 54 Continuous, 55 }; 56 } 57 58 class _CoreExport BaseInputHandler 59 : public OIS::KeyListener, public OIS::MouseListener 60 { 61 virtual void tick(float dt) = 0; 62 }; 63 46 64 /** 47 65 @brief Captures mouse and keyboard input while in the actual game mode. 48 66 Manages the key bindings. 49 67 */ 50 class _CoreExport InputHandlerGame 51 : public OIS::KeyListener, public OIS::MouseListener 68 class _CoreExport InputHandlerGame : public BaseInputHandler 52 69 { 53 70 public: … … 65 82 bool keyReleased (const OIS::KeyEvent &arg); 66 83 84 void tick(float dt); 85 67 86 // temporary hack 68 87 void callListeners(InputEvent &evt); 88 89 //! Stores all the keys that are down 90 std::list<OIS::KeyCode> keysDown_; 69 91 70 92 /** denotes the maximum number of different keys there are in OIS. … … 72 94 static const int numberOfKeys_s = 256; 73 95 //! Array of input events for every pressed key 74 std::string bindingsKeyPress ed_[numberOfKeys_s];96 std::string bindingsKeyPress_[numberOfKeys_s]; 75 97 //! Array of input events for every released key 76 std::string bindingsKeyReleased_[numberOfKeys_s]; 98 std::string bindingsKeyRelease_[numberOfKeys_s]; 99 //! Array of input events for every holding key 100 std::string bindingsKeyHold_[numberOfKeys_s]; 77 101 78 102 /** denotes the maximum number of different buttons there are in OIS. … … 91 115 GUI. 92 116 */ 93 class _CoreExport InputHandlerGUI 94 : public OIS::KeyListener, public OIS::MouseListener 117 class _CoreExport InputHandlerGUI : public BaseInputHandler 95 118 { 96 119 public: 97 120 InputHandlerGUI (); 98 121 ~InputHandlerGUI(); 122 123 void tick(float dt); 99 124 100 125 private:
Note: See TracChangeset
for help on using the changeset viewer.