Changeset 1215 for code/branches/input/src/core/InputHandler.h
- Timestamp:
- May 2, 2008, 9:31:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/core/InputHandler.h
r1213 r1215 40 40 #include "ois/OIS.h" 41 41 #include "OrxonoxClass.h" 42 #include "CommandExecutor.h" 42 43 43 44 namespace orxonox … … 60 61 { 61 62 public: 63 virtual ~KeyHandler() { } 62 64 virtual bool keyHeld(const OIS::KeyEvent &arg) = 0; 63 65 }; … … 69 71 { 70 72 public: 73 virtual ~MouseHandler() { } 71 74 virtual bool mouseHeld(const OIS::MouseEvent &arg, OIS::MouseButtonID id) = 0; 72 75 }; … … 75 78 @brief Interface class used for joy stick input listeners. 76 79 */ 77 class _CoreExport JoyStickHandler : public OIS::JoyStickListener 78 { 79 public: 80 virtual bool buttonHeld(const OIS::JoyStickEvent &arg, int button) = 0; 80 class _CoreExport JoyStickHandler 81 { 82 public: 83 virtual ~JoyStickHandler() { } 84 virtual bool buttonPressed (int joyStickID, const OIS::JoyStickEvent &arg, int button) = 0; 85 virtual bool buttonReleased(int joyStickID, const OIS::JoyStickEvent &arg, int button) = 0; 86 virtual bool buttonHeld (int joyStickID, const OIS::JoyStickEvent &arg, int button) = 0; 87 virtual bool axisMoved (int joyStickID, const OIS::JoyStickEvent &arg, int axis) = 0; 88 virtual bool sliderMoved (int joyStickID, const OIS::JoyStickEvent &arg, int index) {return true;} 89 virtual bool povMoved (int joyStickID, const OIS::JoyStickEvent &arg, int index) {return true;} 90 virtual bool vector3Moved (int joyStickID, const OIS::JoyStickEvent &arg, int index) {return true;} 91 }; 92 93 struct _CoreExport KeyBinding 94 { 95 std::string commandStr; 96 CommandEvaluation evaluation; 81 97 }; 82 98 … … 100 116 101 117 private: // functions 118 119 bool executeBinding(KeyBinding &binding); 120 102 121 bool keyPressed (const OIS::KeyEvent &arg); 103 122 bool keyReleased (const OIS::KeyEvent &arg); … … 109 128 bool mouseMoved (const OIS::MouseEvent &arg); 110 129 111 bool buttonPressed (const OIS::JoyStickEvent &arg, int button); 112 bool buttonReleased(const OIS::JoyStickEvent &arg, int button); 113 bool buttonHeld (const OIS::JoyStickEvent &arg, int button); 114 bool axisMoved (const OIS::JoyStickEvent &arg, int axis); 115 bool sliderMoved (const OIS::JoyStickEvent &arg, int id); 116 bool povMoved (const OIS::JoyStickEvent &arg, int id); 130 bool buttonPressed (int joyStickID, const OIS::JoyStickEvent &arg, int button); 131 bool buttonReleased(int joyStickID, const OIS::JoyStickEvent &arg, int button); 132 bool buttonHeld (int joyStickID, const OIS::JoyStickEvent &arg, int button); 133 bool axisMoved (int joyStickID, const OIS::JoyStickEvent &arg, int axis); 134 bool sliderMoved (int joyStickID, const OIS::JoyStickEvent &arg, int id); 135 bool povMoved (int joyStickID, const OIS::JoyStickEvent &arg, int id); 136 bool vector3Moved (int joyStickID, const OIS::JoyStickEvent &arg, int id); 117 137 118 138 private: // variables … … 121 141 static const int numberOfKeys_s = 0xEE; 122 142 //! Array of input events for every pressed key 123 std::string bindingsKeyPress_ [numberOfKeys_s];143 KeyBinding bindingsKeyPress_ [numberOfKeys_s]; 124 144 //! Array of input events for every released key 125 std::string bindingsKeyRelease_[numberOfKeys_s];145 KeyBinding bindingsKeyRelease_[numberOfKeys_s]; 126 146 //! Array of input events for every held key 127 std::string bindingsKeyHold_ [numberOfKeys_s];147 KeyBinding bindingsKeyHold_ [numberOfKeys_s]; 128 148 //! Names of the keys as strings 129 149 std::string keyNames_[numberOfKeys_s];
Note: See TracChangeset
for help on using the changeset viewer.