Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 19, 2009, 5:31:02 PM (15 years ago)
Author:
rgrieder
Message:

Merged all remaining revisions from core4 back to the trunk.

Location:
code/trunk
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/input/Keyboard.h

    r3276 r3327  
    3131
    3232#include "InputPrereqs.h"
     33
     34#include "InputHandler.h"
    3335#include "InputDevice.h"
    3436
    3537namespace orxonox
    3638{
     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
    3749    /**
    3850    @brief
     
    5163
    5264    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) { }
    5467        ~Keyboard() { }
    5568
    5669    private:
    57         // TODO: Do we need to reset the modifiers?
    58         void clearBuffersImpl() { }
     70        //! Resets the keyboard modifiers
     71        void clearBuffersImpl() { this->modifiers_ = 0; }
    5972        //! 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        }
    6178
    6279        bool keyPressed(const OIS::KeyEvent& arg);
    6380        bool keyReleased(const OIS::KeyEvent& arg);
     81
     82        //! Returns the class name as string
     83        static std::string getClassNameImpl() { return "Keyboard"; }
    6484
    6585        //! Bit mask representing keyboard modifiers
Note: See TracChangeset for help on using the changeset viewer.