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 #ifndef HDB_INPUT_H
23 #define HDB_INPUT_H
24 
25 #include "common/events.h"
26 
27 namespace HDB {
28 
29 enum Button {
30  kButtonUp = 2 << 0,
31  kButtonDown = 2 << 1,
32  kButtonLeft = 2 << 2,
33  kButtonRight = 2 << 3,
34  kButtonA = 2 << 4,
35  kButtonB = 2 << 5,
36  kButtonC = 2 << 6,
37  kButtonD = 2 << 7,
38  kButtonExit = 2 << 8
39 };
40 
41 enum HDBAction {
42  kHDBActionNone,
43  kHDBActionUp,
44  kHDBActionDown,
45  kHDBActionLeft,
46  kHDBActionRight,
47  kHDBActionUse,
48  kHDBActionClearWaypoints,
49  kHDBActionInventory,
50  kHDBActionMenu,
51  kHDBActionPause,
52  kHDBActionDebug,
53  kHDBActionQuit
54 };
55 
56 class Input {
57 public:
58 
59  void init();
60 
61  void setButtons(uint16 b);
62  uint16 getButtons();
63  void stylusDown(int x, int y);
64  void stylusUp(int x, int y);
65  void stylusMove(int x, int y);
66 
67  void updateMouse(int newX, int newY);
68  void updateMouseButtons(bool isDown);
69  void updateActions(Common::Event event, bool keyDown, bool fromMouse);
70 
71  int getMouseX() {
72  return _mouseX;
73  }
74  int getMouseY() {
75  return _mouseY;
76  }
77 
78 private:
79 
80  uint16 _buttons; // Flags for buttons
81  bool _stylusDown;
82  int _mouseX, _mouseY;
83 };
84 
85 } // End of Namespace
86 
87 #endif // !HDB_INPUT_H
Definition: ai-player.h:25
Definition: input.h:56
Definition: events.h:199
Definition: input.h:69