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
38namespace hpl {
39
40class Keyboard;
41class Mouse;
42class LowLevelInput;
43class iInputDevice;
44class iAction;
45
47typedef tActionMap::iterator tActionMapIt;
48
49typedef Common::MultiMap<tString, iAction *> tActionMultiMap;
50typedef tActionMultiMap::iterator tActionMultiMapIt;
51
52typedef Common::List<iInputDevice *> tInputDeviceList;
53typedef tInputDeviceList::iterator tInputDeviceListIt;
54
55class cInput : public iUpdateable {
56public:
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
109
116
121 void DestroyAction(tString asName);
122
128
135
136 LowLevelInput *GetLowLevel() { return mpLowLevelInput; }
137
138private:
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
ListInternal::Iterator< iInputDevice * > iterator
Definition: list.h:52
Definition: multimap.h:34
typename TreeT::BasicIterator iterator
Definition: stablemap.h:48
Definition: str.h:59
Definition: Keyboard.h:45
Definition: LowLevelInput.h:40
Definition: Mouse.h:45
Definition: Input.h:55
void Update(float afTimeStep)
iAction * GetAction(tString asName)
iAction * InputToAction(const tString &asName)
void AddAction(iAction *apAction)
bool WasTriggerd(tString asName)
bool IsTriggerd(tString asName)
bool CheckForInput()
Keyboard * GetKeyboard()
Mouse * GetMouse()
void DestroyAction(tString asName)
bool DoubleTriggerd(tString asName, float afLimit)
bool BecameTriggerd(tString asName)
Definition: Action.h:35
Definition: Updateable.h:35