ScummVM API documentation
ActionKeyboard.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_ACTIONKEYBOARD_H
29 #define HPL_ACTIONKEYBOARD_H
30 
31 #include "common/keyboard.h"
32 #include "hpl1/engine/input/Action.h"
33 #include "hpl1/engine/input/InputTypes.h"
34 
35 namespace hpl {
36 
37 class cInput;
38 
39 class cActionKeyboard : public iAction {
40 public:
41  cActionKeyboard(tString asName, cInput *apInput, Common::KeyState key) : iAction(asName), _key(key), mpInput(apInput) {}
42 
43  bool IsTriggerd();
44  float GetValue();
45 
47 
48  tString GetInputType() { return "Keyboard"; }
49 
50  Common::KeyCode GetKey() { return _key.keycode; }
51  int GetModifier() { return _key.flags; }
52 
53 private:
54  Common::KeyState _key;
55  cInput *mpInput;
56 };
57 
58 } // namespace hpl
59 
60 #endif // HPL_ACTIONKEYBOARD_H
Definition: AI.h:36
Definition: str.h:59
Definition: ActionKeyboard.h:39
tString GetInputType()
Definition: ActionKeyboard.h:48
byte flags
Definition: keyboard.h:323
KeyCode keycode
Definition: keyboard.h:299
Definition: Action.h:35
Definition: Input.h:55
Definition: keyboard.h:294