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 class Input {
35 public:
36 
38  enum {
39  DELAY_SHORT = 10,
40  DELAY_NORMAL = 100, // 5 * 20ms
41  DELAY_SCREEN_BLANKER = 5 * 60 * 1000
42  };
43  enum {
44  MOUSE_LBUTTON = 1,
45  MOUSE_RBUTTON = 2
46  };
47 
48  Input(Common::Language language, OSystem *system);
49 
50  void delay(uint amount);
51 
53  void checkKeys();
54 
56  void clearKeyVerb() { _keyVerb = VERB_NONE; }
57 
58  void canQuit(bool cq) { _canQuit = cq; }
59 
60  bool cutawayRunning() const { return _cutawayRunning; }
61  void cutawayRunning(bool running) { _cutawayRunning = running; }
62 
63  bool cutawayQuit() const { return _cutawayQuit; }
64  void cutawayQuitReset() { _cutawayQuit = false; }
65 
66  void dialogueRunning(bool running) { _dialogueRunning = running; }
67 
68  bool talkQuit() const { return _talkQuit; }
69  void talkQuitReset() { _talkQuit = false; }
70 
71  bool quickSave() const { return _quickSave; }
72  void quickSaveReset() { _quickSave = false; }
73  bool quickLoad() const { return _quickLoad; }
74  void quickLoadReset() { _quickLoad = false; }
75 
76  bool fastMode() const { return _fastMode; }
77  void fastMode(bool fm) { _fastMode = fm; }
78 
79  Verb keyVerb() const { return _keyVerb; }
80 
81  Common::Point getMousePos() const;
82 
83  int mouseButton() const { return _mouseButton; }
84  void clearMouseButton() { _mouseButton = 0; }
85 
87  uint32 idleTime() const { return _idleTime; }
88 
89 private:
90 
92  OSystem *_system;
93 
94  Common::EventManager *_eventMan;
95 
97  bool _fastMode;
98 
100  Verb _keyVerb;
101 
103  bool _cutawayRunning;
104 
106  bool _canQuit;
107 
109  bool _cutawayQuit;
110 
112  bool _dialogueRunning;
113 
115  bool _talkQuit;
116 
118  bool _quickSave;
119 
121  bool _quickLoad;
122 
124  Common::KeyCode _inKey;
125 
127  int _mouseButton;
128 
130  uint32 _idleTime;
131 
133  const char *_currentCommandKeys;
134 
136  static const char *const _commandKeys[];
137 
139  static const Verb _verbKeys[];
140 };
141 
142 } // End of namespace Queen
143 
144 #endif
uint32 idleTime() const
returns user idle time (used by Display, to trigger the screensaver)
Definition: input.h:87
Definition: bankman.h:28
Definition: rect.h:45
void checkKeys()
convert input to verb
Definition: system.h:161
Definition: events.h:472
Definition: input.h:34
void clearKeyVerb()
use instead of KEYVERB=0
Definition: input.h:56
Language
Definition: language.h:45