Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/core/input/ExtendedInputState.h @ 3196

Last change on this file since 3196 was 3196, checked in by rgrieder, 15 years ago

Merged pch branch back to trunk.

  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30@file
31@brief
32*/
33
34#ifndef _ExtendedInputState_H__
35#define _ExtendedInputState_H__
36
37#include "core/CorePrereqs.h"
38
39#include <vector>
40#include "InputInterfaces.h"
41#include "InputState.h"
42
43namespace orxonox
44{
45
46    class _CoreExport ExtendedInputState : public InputState
47    {
48        friend class InputManager;
49
50    public:
51        bool addKeyHandler        (KeyHandler* handler);
52        bool removeKeyHandler     (KeyHandler* handler);
53
54        bool addMouseHandler      (MouseHandler* handler);
55        bool removeMouseHandler   (MouseHandler* handler);
56
57        bool addJoyStickHandler   (JoyStickHandler* handler, unsigned int joyStickID);
58        bool removeJoyStickHandler(JoyStickHandler* handler, unsigned int joyStickID);
59        bool addJoyStickHandler   (JoyStickHandler* handler);
60        bool removeJoyStickHandler(JoyStickHandler* handler);
61
62        bool addHandler(InputHandler* handler);
63        bool removeHandler(InputHandler* handler);
64
65    private:
66        ExtendedInputState() { }
67        ~ExtendedInputState() { }
68
69        void updateInput(float dt);
70        void updateInput(float dt, unsigned int device);
71
72        void keyPressed (const KeyEvent& evt);
73        void keyReleased(const KeyEvent& evt);
74        void keyHeld    (const KeyEvent& evt);
75
76        void mouseButtonPressed (MouseButtonCode::ByEnum id);
77        void mouseButtonReleased(MouseButtonCode::ByEnum id);
78        void mouseButtonHeld    (MouseButtonCode::ByEnum id);
79        void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
80        void mouseScrolled      (int abs, int rel);
81
82        void joyStickButtonPressed (unsigned int joyStickID, JoyStickButtonCode::ByEnum id);
83        void joyStickButtonReleased(unsigned int joyStickID, JoyStickButtonCode::ByEnum id);
84        void joyStickButtonHeld    (unsigned int joyStickID, JoyStickButtonCode::ByEnum id);
85        void joyStickAxisMoved     (unsigned int joyStickID, unsigned int axis, float value);        void updateTickables();
86
87        void numberOfJoySticksChanged(unsigned int n);
88        void update();
89
90        void onEnter();
91        void onLeave();
92
93        std::vector<KeyHandler*>                    keyHandlers_;
94        std::vector<MouseHandler*>                  mouseHandlers_;
95        std::vector<std::vector<JoyStickHandler*> > joyStickHandlers_;
96        std::vector<JoyStickHandler*>               joyStickHandlersAll_;
97
98        std::vector<InputHandler*> allHandlers_;
99    };
100}
101
102#endif /* _ExtendedInputState_H__ */
Note: See TracBrowser for help on using the repository browser.