ScummVM API documentation
Input.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of HPL1 Engine.
26  */
27 
28 #ifndef HPL_INPUT_H
29 #define HPL_INPUT_H
30 
31 #include "common/list.h"
32 #include "hpl1/engine/game/Updateable.h"
33 #include "hpl1/engine/input/InputTypes.h"
34 #include "hpl1/engine/system/SystemTypes.h"
35 #include "common/stablemap.h"
36 #include "common/multimap.h"
37 
38 namespace hpl {
39 
40 class Keyboard;
41 class Mouse;
42 class LowLevelInput;
43 class iInputDevice;
44 class iAction;
45 
46 typedef Common::StableMap<tString, iAction *> tActionMap;
47 typedef tActionMap::iterator tActionMapIt;
48 
49 typedef Common::MultiMap<tString, iAction *> tActionMultiMap;
50 typedef tActionMultiMap::iterator tActionMultiMapIt;
51 
52 typedef Common::List<iInputDevice *> tInputDeviceList;
53 typedef tInputDeviceList::iterator tInputDeviceListIt;
54 
55 class cInput : public iUpdateable {
56 public:
57  cInput(LowLevelInput *apLowLevelInput);
58  ~cInput();
59 
63  void Update(float afTimeStep);
64 
69  void AddAction(iAction *apAction);
70 
76  bool IsTriggerd(tString asName);
82  bool WasTriggerd(tString asName);
83 
89  bool BecameTriggerd(tString asName);
90 
96  bool DoubleTriggerd(tString asName, float afLimit);
97 
103 
108  Mouse *GetMouse();
109 
115  iAction *GetAction(tString asName);
116 
121  void DestroyAction(tString asName);
122 
127  bool CheckForInput();
128 
134  iAction *InputToAction(const tString &asName);
135 
136  LowLevelInput *GetLowLevel() { return mpLowLevelInput; }
137 
138 private:
139  tActionMap m_mapActions;
140  tInputDeviceList mlstInputDevices;
141 
142  LowLevelInput *mpLowLevelInput;
143 
144  Mouse *mpMouse;
145  Keyboard *mpKeyboard;
146 };
147 } // namespace hpl
148 
149 #endif // HPL_INPUT_H
Definition: Mouse.h:45
Definition: AI.h:36
Definition: Keyboard.h:45
iAction * GetAction(tString asName)
bool WasTriggerd(tString asName)
Definition: str.h:59
bool DoubleTriggerd(tString asName, float afLimit)
bool IsTriggerd(tString asName)
typename TreeT::BasicIterator iterator
Definition: stablemap.h:48
Definition: LowLevelInput.h:40
bool CheckForInput()
Definition: multimap.h:34
Definition: Action.h:35
Mouse * GetMouse()
iAction * InputToAction(const tString &asName)
void Update(float afTimeStep)
Keyboard * GetKeyboard()
bool BecameTriggerd(tString asName)
Definition: Input.h:55
void DestroyAction(tString asName)
ListInternal::Iterator< t_T > iterator
Definition: list.h:52
Definition: Updateable.h:35
void AddAction(iAction *apAction)