Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 20, 2008, 6:49:24 PM (16 years ago)
Author:
rgrieder
Message:

Finally! The InputManager is now working like I imagined it to. And it's even easier to use it as well.
A little explanation: Every time you change something about the input distribution, it is a change of 'state' represented by the class 'InputState'.
That can be for instance: "console", "game", "gui", etc. Every state has a name and a priority which describes who comes first. Now if one state doesn't handle mouse input or instance, then the one with the next lower priority gets it. To prevent that, you can add the 'EmptyHandler' to the state with setMouseHandler.
InputState is just an abstract base class. There are two classes implementing it: SimpleInputState and ExtendedInputState. The latter allows for multiple input handlers for one single device.

Basically, what you need to know is what you see in Orxonox.cc, InGameConsole.cc and Shell.cc.

File:
1 edited

Legend:

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

    r1630 r1637  
    6464
    6565    protected: // functions
    66         void tickInput(float dt, const HandlerState& state);
     66        void tickInput(float dt);
     67        //void tickInput(float dt, int device);
     68        void tickKey(float dt) { }
     69        void tickMouse(float dt);
     70        void tickJoyStick(float dt, int device);
     71        void tickDevices(unsigned int begin, unsigned int end);
    6772
    6873        virtual void readTrigger(Button& button);
     
    7883        void mouseScrolled      (int abs, int rel);
    7984
    80         void joyStickButtonPressed (int joyStickID, int button);
    81         void joyStickButtonReleased(int joyStickID, int button);
    82         void joyStickButtonHeld    (int joyStickID, int button);
    83         void joyStickAxisMoved     (int joyStickID, int axis, float value);
     85        void joyStickButtonPressed (unsigned int joyStickID, unsigned int button);
     86        void joyStickButtonReleased(unsigned int joyStickID, unsigned int button);
     87        void joyStickButtonHeld    (unsigned int joyStickID, unsigned int button);
     88        void joyStickAxisMoved     (unsigned int joyStickID, unsigned int axis, float value);
    8489
    8590    protected: // variables
Note: See TracChangeset for help on using the changeset viewer.