Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 24, 2008, 9:40:23 PM (16 years ago)
Author:
rgrieder
Message:
  • InputManager works so far, but has to be largely extended
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/core/InputHandler.h

    r1062 r1182  
    3838
    3939#include <string>
     40#include <list>
    4041#include <OIS/OIS.h>
    4142
     
    4445namespace orxonox
    4546{
     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   
    4664  /**
    4765    @brief Captures mouse and keyboard input while in the actual game mode.
    4866    Manages the key bindings.
    4967  */
    50   class _CoreExport InputHandlerGame
    51         : public OIS::KeyListener, public OIS::MouseListener
     68  class _CoreExport InputHandlerGame : public BaseInputHandler
    5269  {
    5370  public:
     
    6582                bool keyReleased  (const OIS::KeyEvent   &arg);
    6683
     84    void tick(float dt);
     85
    6786    // temporary hack
    6887    void callListeners(InputEvent &evt);
     88
     89    //! Stores all the keys that are down
     90    std::list<OIS::KeyCode> keysDown_;
    6991
    7092    /** denotes the maximum number of different keys there are in OIS.
     
    7294    static const int numberOfKeys_s = 256;
    7395    //! Array of input events for every pressed key
    74     std::string bindingsKeyPressed_[numberOfKeys_s];
     96    std::string bindingsKeyPress_[numberOfKeys_s];
    7597    //! 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];
    77101
    78102    /** denotes the maximum number of different buttons there are in OIS.
     
    91115    GUI.
    92116  */
    93   class _CoreExport InputHandlerGUI
    94         : public OIS::KeyListener, public OIS::MouseListener
     117  class _CoreExport InputHandlerGUI : public BaseInputHandler
    95118  {
    96119  public:
    97120    InputHandlerGUI ();
    98121    ~InputHandlerGUI();
     122
     123    void tick(float dt);
    99124
    100125  private:
Note: See TracChangeset for help on using the changeset viewer.