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 QUEEN_INPUT_H
23 #define QUEEN_INPUT_H
24 
25 #include "common/language.h"
26 #include "common/rect.h"
27 #include "common/events.h"
28 #include "queen/defs.h"
29 
30 class OSystem;
31 
32 namespace Queen {
33 
34 struct verbAction {
35  Verb _verb;
37 };
38 
39 class Input {
40 public:
41 
43  enum {
44  DELAY_SHORT = 10,
45  DELAY_NORMAL = 100, // 5 * 20ms
46  DELAY_SCREEN_BLANKER = 5 * 60 * 1000
47  };
48  enum {
49  MOUSE_LBUTTON = 1,
50  MOUSE_RBUTTON = 2
51  };
52 
53  Input(Common::Language language, OSystem *system);
54 
55  void delay(uint amount);
56 
58  void checkKeys();
59 
61  void clearKeyVerb() { _keyVerb = VERB_NONE; }
62 
63  void canQuit(bool cq) { _canQuit = cq; }
64 
65  bool cutawayRunning() const { return _cutawayRunning; }
66  void cutawayRunning(bool running) { _cutawayRunning = running; }
67 
68  bool cutawayQuit() const { return _cutawayQuit; }
69  void cutawayQuitReset() { _cutawayQuit = false; }
70 
71  void dialogueRunning(bool running) { _dialogueRunning = running; }
72 
73  bool talkQuit() const { return _talkQuit; }
74  void talkQuitReset() { _talkQuit = false; }
75 
76  bool quickSave() const { return _quickSave; }
77  void quickSaveReset() { _quickSave = false; }
78  bool quickLoad() const { return _quickLoad; }
79  void quickLoadReset() { _quickLoad = false; }
80 
81  bool fastMode() const { return _fastMode; }
82  void fastMode(bool fm) { _fastMode = fm; }
83 
84  Verb keyVerb() const { return _keyVerb; }
85 
86  Common::Point getMousePos() const;
87 
88  int mouseButton() const { return _mouseButton; }
89  void clearMouseButton() { _mouseButton = 0; }
90 
92  uint32 idleTime() const { return _idleTime; }
93 
94 private:
95 
97  OSystem *_system;
98 
99  Common::EventManager *_eventMan;
100 
102  bool _fastMode;
103 
105  Verb _keyVerb;
106 
108  bool _cutawayRunning;
109 
111  bool _canQuit;
112 
114  bool _cutawayQuit;
115 
117  bool _dialogueRunning;
118 
120  bool _talkQuit;
121 
123  bool _quickSave;
124 
126  bool _quickLoad;
127 
130 
132  int _mouseButton;
133 
135  uint32 _idleTime;
136 
138  static const verbAction _verbActions[];
139 };
140 
141 } // End of namespace Queen
142 
143 #endif
uint32 idleTime() const
returns user idle time (used by Display, to trigger the screensaver)
Definition: input.h:92
uint32 CustomEventType
Definition: events.h:204
Definition: bankman.h:28
Definition: rect.h:144
Definition: system.h:163
Definition: events.h:483
Definition: input.h:34
Definition: input.h:39
void clearKeyVerb()
use instead of KEYVERB=0
Definition: input.h:61
Language
Definition: language.h:45