Changeset 3327 for code/trunk/src/core/input/Keyboard.h
- Timestamp:
- Jul 19, 2009, 5:31:02 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core4 merged: 3269,3271-3275,3278,3285,3290-3294,3310
- Property svn:mergeinfo changed
-
code/trunk/src/core/input/Keyboard.h
r3276 r3327 31 31 32 32 #include "InputPrereqs.h" 33 34 #include "InputHandler.h" 33 35 #include "InputDevice.h" 34 36 35 37 namespace orxonox 36 38 { 39 //! Template parameter collection for the base class 40 struct KeyboardTraits 41 { 42 typedef Keyboard DeviceClass; 43 typedef OIS::Keyboard OISDeviceClass; 44 typedef KeyEvent ButtonType; 45 typedef KeyEvent& ButtonTypeParam; 46 static const OIS::Type OISDeviceValue = OIS::OISKeyboard; 47 }; 48 37 49 /** 38 50 @brief … … 51 63 52 64 public: 53 Keyboard(unsigned int id) : super(id), modifiers_(0) { } 65 //! Only resets the keyboard modifiers. Initialising is done in the base class. 66 Keyboard(unsigned int id, OIS::InputManager* oisInputManager) : super(id, oisInputManager), modifiers_(0) { } 54 67 ~Keyboard() { } 55 68 56 69 private: 57 // TODO: Do we need to reset the modifiers?58 void clearBuffersImpl() { }70 //! Resets the keyboard modifiers 71 void clearBuffersImpl() { this->modifiers_ = 0; } 59 72 //! Translates the KeyHandle to a KeyEvent 60 KeyEvent& getButtonEventArg(KeyEvent& button) { button.setModifiers(modifiers_); return button; } 73 KeyEvent& getButtonEventArg(KeyEvent& button) 74 { 75 button.setModifiers(modifiers_); 76 return button; 77 } 61 78 62 79 bool keyPressed(const OIS::KeyEvent& arg); 63 80 bool keyReleased(const OIS::KeyEvent& arg); 81 82 //! Returns the class name as string 83 static std::string getClassNameImpl() { return "Keyboard"; } 64 84 65 85 //! Bit mask representing keyboard modifiers
Note: See TracChangeset
for help on using the changeset viewer.