1 /*
2  *  Copyright (C) 2011-2016  OpenDungeons Team
3  *
4  *  This program is free software: you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation, either version 3 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INPUTMANAGER_H
19 #define INPUTMANAGER_H
20 
21 #include <OgreVector3.h>
22 
23 namespace OIS
24 {
25     class InputManager;
26     class Keyboard;
27     class Mouse;
28 }
29 
30 namespace Ogre
31 {
32   class RenderWindow;
33 }
34 
35 enum class InputCommandState
36 {
37     infoOnly, // When the player is only moving mouse (but not building)
38     building, // When the player is building (but has not validated he build)
39     validated // When the player is happy with the build and wants to build
40 };
41 
42 class InputManager
43 {
44 public:
45     InputManager(Ogre::RenderWindow* renderWindow);
46     ~InputManager();
47 
48     OIS::InputManager*  mInputManager;
49 
50     OIS::Keyboard*      mKeyboard;
51     bool                mHotkeyLocationIsValid[10];
52     Ogre::Vector3       mHotkeyLocation[10];
53 
54     //! \brief mouse handling related member
55     OIS::Mouse*         mMouse;
56     bool                mLMouseDown, mRMouseDown, mMMouseDown;
57     bool                mMouseDownOnCEGUIWindow;
58 
59     Ogre::Vector3       mKeeperHandPos;
60     int                 mXPos, mYPos;
61     int                 mLStartDragX, mLStartDragY;
62     int                 mRStartDragX, mRStartDragY;
63     //! \brief In editor mode, it contains the selected seat Id. In gamemode, it is not used
64     int                 mSeatIdSelected;
65     InputCommandState   mCommandState;
66 };
67 
68 #endif // INPUTMANAGER_H
69