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  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_INPUT_H
26 #define PEGASUS_INPUT_H
27 
28 #include "common/events.h"
29 #include "common/rect.h"
30 #include "common/singleton.h"
31 
32 #include "pegasus/constants.h"
33 #include "pegasus/types.h"
34 
35 namespace Pegasus {
36 
37 class Hotspot;
38 class Input;
39 
40 enum PegasusAction {
41  kPegasusActionNone,
42  kPegasusActionUp,
43  kPegasusActionDown,
44  kPegasusActionLeft,
45  kPegasusActionRight,
46  kPegasusActionInteract,
47  kPegasusActionShowInventory,
48  kPegasusActionShowBiochip,
49  kPegasusActionToggleCenterDisplay,
50  kPegasusActionShowInfoScreen,
51  kPegasusActionShowPauseMenu,
52  kPegasusActionSaveGameState,
53  kPegasusActionLoadGameState,
54  kPegasusActionEnableEasterEgg,
55  kPegasusActionToggleChattyAI,
56 
57  kPegasusActionCount
58 };
59 
60 class InputDeviceManager : public Common::Singleton<InputDeviceManager>, public Common::EventObserver {
61 public:
63  ~InputDeviceManager() override;
64 
65  bool notifyEvent(const Common::Event &event) override;
66 
67  void getInput(Input &, const InputBits);
68 
69  void waitInput(const InputBits);
70 
71  void pumpEvents();
72 
73 protected:
74  friend class Common::Singleton<SingletonBaseType>;
75 
76  // Keep track of which keys are down (= true) or not
77  bool _keysDown[kPegasusActionCount];
78  InputBits _lastRawBits;
79  bool _AKeyWasDown;
80 };
81 
82 enum {
83  kButtonDownBit = 0,
84  kAutoButtonBit = 1,
85  kBitsPerButton = 2,
86 
87  kButtonDownMask = 1 << kButtonDownBit,
88  kAutoButtonMask = 1 << kAutoButtonBit,
89 
90  kButtonStateBits = kButtonDownMask | kAutoButtonMask,
91 
92  kRawButtonUp = 0,
93  kRawButtonDown = kButtonDownMask | kAutoButtonMask,
94 
95  kButtonUp = 0,
96  kButtonDown = kButtonDownMask,
97  kButtonAutoUp = kAutoButtonMask,
98  kButtonAutoDown = kButtonDownMask | kAutoButtonMask
99 };
100 
101 enum {
102  kUpButtonNum = 0,
103  kLeftButtonNum = 1,
104  kDownButtonNum = 2,
105  kRightButtonNum = 3,
106  kLeftFireButtonNum = 4,
107  kRightFireButtonNum = 5,
108  kOneButtonNum = 6,
109  kTwoButtonNum = 7,
110  kThreeButtonNum = 8,
111  kFourButtonNum = 9,
112  kMod1ButtonNum = 10,
113  kMod2ButtonNum = 11,
114  kMod3ButtonNum = 12
115 };
116 
117 enum {
118  kUpButtonShift = kUpButtonNum * kBitsPerButton,
119  kLeftButtonShift = kLeftButtonNum * kBitsPerButton,
120  kDownButtonShift = kDownButtonNum * kBitsPerButton,
121  kRightButtonShift = kRightButtonNum * kBitsPerButton,
122  kLeftFireButtonShift = kLeftFireButtonNum * kBitsPerButton,
123  kRightFireButtonShift = kRightFireButtonNum * kBitsPerButton,
124  kOneButtonShift = kOneButtonNum * kBitsPerButton,
125  kTwoButtonShift = kTwoButtonNum * kBitsPerButton,
126  kThreeButtonShift = kThreeButtonNum * kBitsPerButton,
127  kFourButtonShift = kFourButtonNum * kBitsPerButton,
128  kMod1ButtonShift = kMod1ButtonNum * kBitsPerButton,
129  kMod2ButtonShift = kMod2ButtonNum * kBitsPerButton,
130  kMod3ButtonShift = kMod3ButtonNum * kBitsPerButton
131 };
132 
133 enum {
134  kAllUpBits = (kButtonUp << kUpButtonShift) |
135  (kButtonUp << kLeftButtonShift) |
136  (kButtonUp << kDownButtonShift) |
137  (kButtonUp << kRightButtonShift) |
138  (kButtonUp << kLeftFireButtonShift) |
139  (kButtonUp << kRightFireButtonShift) |
140  (kButtonUp << kOneButtonShift) |
141  (kButtonUp << kTwoButtonShift) |
142  (kButtonUp << kThreeButtonShift) |
143  (kButtonUp << kFourButtonShift) |
144  (kButtonUp << kMod1ButtonShift) |
145  (kButtonUp << kMod2ButtonShift) |
146  (kButtonUp << kMod3ButtonShift),
147  kDirectionBits = (kButtonDownMask << kUpButtonShift) |
148  (kButtonDownMask << kLeftButtonShift) |
149  (kButtonDownMask << kDownButtonShift) |
150  (kButtonDownMask << kRightButtonShift),
151  kButtonBits = (kButtonDownMask << kLeftFireButtonShift) |
152  (kButtonDownMask << kRightFireButtonShift) |
153  (kButtonDownMask << kOneButtonShift) |
154  (kButtonDownMask << kTwoButtonShift) |
155  (kButtonDownMask << kThreeButtonShift) |
156  (kButtonDownMask << kFourButtonShift) |
157  (kButtonDownMask << kMod1ButtonShift) |
158  (kButtonDownMask << kMod2ButtonShift) |
159  (kButtonDownMask << kMod3ButtonShift),
160  kAllButtonDownBits = kDirectionBits | kButtonBits,
161  kAllAutoBits = (kAutoButtonMask << kUpButtonShift) |
162  (kAutoButtonMask << kLeftButtonShift) |
163  (kAutoButtonMask << kDownButtonShift) |
164  (kAutoButtonMask << kRightButtonShift) |
165  (kAutoButtonMask << kLeftFireButtonShift) |
166  (kAutoButtonMask << kRightFireButtonShift) |
167  (kAutoButtonMask << kOneButtonShift) |
168  (kAutoButtonMask << kTwoButtonShift) |
169  (kAutoButtonMask << kThreeButtonShift) |
170  (kAutoButtonMask << kFourButtonShift) |
171  (kAutoButtonMask << kMod1ButtonShift) |
172  (kAutoButtonMask << kMod2ButtonShift) |
173  (kAutoButtonMask << kMod3ButtonShift),
174 
175  kFilterUpButton = kButtonDownMask << kUpButtonShift,
176  kFilterUpAuto = kAutoButtonMask << kUpButtonShift,
177  kFilterUpButtonAny = kFilterUpButton | kFilterUpAuto,
178  kFilterLeftButton = kButtonDownMask << kLeftButtonShift,
179  kFilterLeftAuto = kAutoButtonMask << kLeftButtonShift,
180  kFilterLeftButtonAny = kFilterLeftButton | kFilterLeftAuto,
181  kFilterDownButton = kButtonDownMask << kDownButtonShift,
182  kFilterDownAuto = kAutoButtonMask << kDownButtonShift,
183  kFilterDownButtonAny = kFilterDownButton | kFilterDownAuto,
184  kFilterRightButton = kButtonDownMask << kRightButtonShift,
185  kFilterRightAuto = kAutoButtonMask << kRightButtonShift,
186  kFilterRightButtonAny = kFilterRightButton | kFilterRightAuto,
187  kFilterLeftFireButton = kButtonDownMask << kLeftFireButtonShift,
188  kFilterLeftFireAuto = kAutoButtonMask << kLeftFireButtonShift,
189  kFilterLeftFireButtonAny = kFilterLeftFireButton | kFilterLeftFireAuto,
190  kFilterRightFireButton = kButtonDownMask << kRightFireButtonShift,
191  kFilterRightFireAuto = kAutoButtonMask << kRightFireButtonShift,
192  kFilterRightFireButtonAny = kFilterRightFireButton | kFilterRightFireAuto,
193  kFilterOneButton = kButtonDownMask << kOneButtonShift,
194  kFilterOneAuto = kAutoButtonMask << kOneButtonShift,
195  kFilterOneButtonAny = kFilterOneButton | kFilterOneAuto,
196  kFilterTwoButton = kButtonDownMask << kTwoButtonShift,
197  kFilterTwoAuto = kAutoButtonMask << kTwoButtonShift,
198  kFilterTwoButtonAny = kFilterTwoButton | kFilterTwoAuto,
199  kFilterThreeButton = kButtonDownMask << kThreeButtonShift,
200  kFilterThreeAuto = kAutoButtonMask << kThreeButtonShift,
201  kFilterThreeButtonAny = kFilterThreeButton | kFilterThreeAuto,
202  kFilterFourButton = kButtonDownMask << kFourButtonShift,
203  kFilterFourAuto = kAutoButtonMask << kFourButtonShift,
204  kFilterFourButtonAny = kFilterFourButton | kFilterFourAuto,
205  kFilterMod1Button = kButtonDownMask << kMod1ButtonShift,
206  kFilterMod1Auto = kAutoButtonMask << kMod1ButtonShift,
207  kFilterMod1ButtonAny = kFilterMod1Button | kFilterMod1Auto,
208  kFilterMod2Button = kButtonDownMask << kMod2ButtonShift,
209  kFilterMod2Auto = kAutoButtonMask << kMod2ButtonShift,
210  kFilterMod2ButtonAny = kFilterMod2Button | kFilterMod2Auto,
211  kFilterMod3Button = kButtonDownMask << kMod3ButtonShift,
212  kFilterMod3Auto = kAutoButtonMask << kMod3ButtonShift,
213  kFilterMod3ButtonAny = kFilterMod3Button | kFilterMod3Auto,
214 
215  kFilterNoInput = 0,
216  kFilterAllInput = kFilterUpButton |
217  kFilterUpAuto |
218  kFilterLeftButton |
219  kFilterLeftAuto |
220  kFilterDownButton |
221  kFilterDownAuto |
222  kFilterRightButton |
223  kFilterRightAuto |
224  kFilterLeftFireButton |
225  kFilterLeftFireAuto |
226  kFilterRightFireButton |
227  kFilterRightFireAuto |
228  kFilterOneButton |
229  kFilterOneAuto |
230  kFilterTwoButton |
231  kFilterTwoAuto |
232  kFilterThreeButton |
233  kFilterThreeAuto |
234  kFilterFourButton |
235  kFilterFourAuto |
236  kFilterMod1Button |
237  kFilterMod1Auto |
238  kFilterMod2Button |
239  kFilterMod2Auto |
240  kFilterMod3Button |
241  kFilterMod3Auto,
242 
243  kFilterAllDirections = kFilterUpButton |
244  kFilterUpAuto |
245  kFilterLeftButton |
246  kFilterLeftAuto |
247  kFilterDownButton |
248  kFilterDownAuto |
249  kFilterRightButton |
250  kFilterRightAuto,
251 
252  kFilterButtons = kFilterOneButton |
253  kFilterOneAuto |
254  kFilterTwoButton |
255  kFilterTwoAuto |
256  kFilterThreeButton |
257  kFilterThreeAuto |
258  kFilterFourButton |
259  kFilterFourAuto,
260 
261  kFilterFireButtons = kFilterLeftFireButton |
262  kFilterLeftFireAuto |
263  kFilterRightFireButton |
264  kFilterRightFireAuto,
265 
266  kFilterAllButtons = kFilterLeftFireButton |
267  kFilterLeftFireAuto |
268  kFilterRightFireButton |
269  kFilterRightFireAuto |
270  kFilterOneButton |
271  kFilterOneAuto |
272  kFilterTwoButton |
273  kFilterTwoAuto |
274  kFilterThreeButton |
275  kFilterThreeAuto |
276  kFilterFourButton |
277  kFilterFourAuto |
278  kFilterMod1Button |
279  kFilterMod1Auto |
280  kFilterMod2Button |
281  kFilterMod2Auto |
282  kFilterMod3Button |
283  kFilterMod3Auto,
284 
285  kFilterAllInputNoAuto = kFilterUpButton |
286  kFilterLeftButton |
287  kFilterDownButton |
288  kFilterRightButton |
289  kFilterLeftFireButton |
290  kFilterRightFireButton |
291  kFilterOneButton |
292  kFilterTwoButton |
293  kFilterThreeButton |
294  kFilterFourButton |
295  kFilterMod1Button |
296  kFilterMod2Button |
297  kFilterMod3Button
298 };
299 
300 static const InputBits kHintInterruption = kFilterAllInputNoAuto;
301 static const InputBits kWarningInterruption = kFilterAllInputNoAuto;
302 static const InputBits kOpticalInterruption = kFilterAllInputNoAuto;
303 
304 /*
305 
306  Buttons are defined as:
307  up, left, down, right direction buttons.
308  fireLeft, fireRight: fire buttons.
309  mod1, mod2, mod3: modifier buttons, similar to shift, control, etc.
310  a, b, c, d: general purpose buttons.
311 
312  button state is held as bits in a long word, two bits per button.
313 
314  Filter bits:
315  for each button, two bits are assigned for filtering. If bit 0 is set, the
316  corresponding button is available for "button down" input. If bit 1 is set,
317  the corresponding button is available for "auto down" input. Note that bit
318  1 is meaningful only if bit 0 is set.
319 
320 */
321 
322 class Input {
323 friend int operator==(const Input &, const Input &);
324 friend int operator!=(const Input &, const Input &);
325 friend class InputDeviceManager;
326 
327 public:
328  Input() { clearInput(); }
329 
330  bool upButtonDown() const { return (_inputState & (kButtonStateBits << kUpButtonShift)) == (kButtonDown << kUpButtonShift); }
331  bool upButtonAutoDown() const { return (_inputState & (kButtonStateBits << kUpButtonShift)) == (kButtonAutoDown << kUpButtonShift); }
332  bool upButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kUpButtonShift)) != 0; }
333 
334  bool leftButtonDown() const { return (_inputState & (kButtonStateBits << kLeftButtonShift)) == (kButtonDown << kLeftButtonShift); }
335  bool leftButtonAutoDown() const { return (_inputState & (kButtonStateBits << kLeftButtonShift)) == (kButtonAutoDown << kLeftButtonShift); }
336  bool leftButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kLeftButtonShift)) != 0; }
337 
338  bool downButtonDown() const { return (_inputState & (kButtonStateBits << kDownButtonShift)) == (kButtonDown << kDownButtonShift); }
339  bool downButtonAutoDown() const { return (_inputState & (kButtonStateBits << kDownButtonShift)) == (kButtonAutoDown << kDownButtonShift); }
340  bool downButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kDownButtonShift)) != 0; }
341 
342  bool rightButtonDown() const { return (_inputState & (kButtonStateBits << kRightButtonShift)) == (kButtonDown << kRightButtonShift); }
343  bool rightButtonAutoDown() const { return (_inputState & (kButtonStateBits << kRightButtonShift)) == (kButtonAutoDown << kRightButtonShift); }
344  bool rightButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kRightButtonShift)) != 0; }
345 
346  bool leftFireButtonDown() const { return (_inputState & (kButtonStateBits << kLeftFireButtonShift)) == (kButtonDown << kLeftFireButtonShift); }
347  bool leftFireButtonAutoDown() const { return (_inputState & (kButtonStateBits << kLeftFireButtonShift)) == (kButtonAutoDown << kLeftFireButtonShift); }
348  bool leftFireButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kLeftFireButtonShift)) != 0; }
349 
350  bool rightFireButtonDown() const { return (_inputState & (kButtonStateBits << kRightFireButtonShift)) == (kButtonDown << kRightFireButtonShift); }
351  bool rightFireButtonAutoDown() const { return (_inputState & (kButtonStateBits << kRightFireButtonShift)) == (kButtonAutoDown << kRightFireButtonShift); }
352  bool rightFireButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kRightFireButtonShift)) != 0; }
353 
354  bool oneButtonDown() const { return (_inputState & (kButtonStateBits << kOneButtonShift)) == (kButtonDown << kOneButtonShift); }
355  bool oneButtonAutoDown() const { return (_inputState & (kButtonStateBits << kOneButtonShift)) == (kButtonAutoDown << kOneButtonShift); }
356  bool oneButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kOneButtonShift)) != 0; }
357 
358  bool twoButtonDown() const { return (_inputState & (kButtonStateBits << kTwoButtonShift)) == (kButtonDown << kTwoButtonShift); }
359  bool twoButtonAutoDown() const { return (_inputState & (kButtonStateBits << kTwoButtonShift)) == (kButtonAutoDown << kTwoButtonShift); }
360  bool twoButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kTwoButtonShift)) != 0; }
361 
362  bool threeButtonDown() const { return (_inputState & (kButtonStateBits << kThreeButtonShift)) == (kButtonDown << kThreeButtonShift); }
363  bool threeButtonAutoDown() const { return (_inputState & (kButtonStateBits << kThreeButtonShift)) == (kButtonAutoDown << kThreeButtonShift); }
364  bool threeButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kThreeButtonShift)) != 0; }
365 
366  bool fourButtonDown() const { return (_inputState & (kButtonStateBits << kFourButtonShift)) == (kButtonDown << kFourButtonShift); }
367  bool fourButtonAutoDown() const { return (_inputState & (kButtonStateBits << kFourButtonShift)) == (kButtonAutoDown << kFourButtonShift); }
368  bool fourButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kFourButtonShift)) != 0; }
369 
370  bool mod1ButtonDown() const { return (_inputState & (kButtonStateBits << kMod1ButtonShift)) == (kButtonDown << kMod1ButtonShift); }
371  bool mod1ButtonAutoDown() const { return (_inputState & (kButtonStateBits << kMod1ButtonShift)) == (kButtonAutoDown << kMod1ButtonShift); }
372  bool mod1ButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kMod1ButtonShift)) != 0; }
373 
374  bool mod2ButtonDown() const { return (_inputState & (kButtonStateBits << kMod2ButtonShift)) == (kButtonDown << kMod2ButtonShift); }
375  bool mod2ButtonAutoDown() const { return (_inputState & (kButtonStateBits << kMod2ButtonShift)) == (kButtonAutoDown << kMod2ButtonShift); }
376  bool mod2ButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kMod2ButtonShift)) != 0; }
377 
378  bool mod3ButtonDown() const { return (_inputState & (kButtonStateBits << kMod3ButtonShift)) == (kButtonDown << kMod3ButtonShift); }
379  bool mod3ButtonAutoDown() const { return (_inputState & (kButtonStateBits << kMod3ButtonShift)) == (kButtonAutoDown << kMod3ButtonShift); }
380  bool mod3ButtonAnyDown() const { return (_inputState & (kButtonAutoDown << kMod3ButtonShift)) != 0; }
381 
382  bool allAutoInput() const { return (_inputState & kAllAutoBits) != 0; }
383  bool anyDirectionInput() const { return (_inputState & kDirectionBits) != 0; }
384  bool anyButtonInput() const { return (_inputState & kButtonBits) != 0; }
385  bool anyInput() const { return _inputState != 0; }
386 
387  void getInputLocation(Common::Point &where) const { where = _inputLocation; }
388 
389  bool anyInputBitSet(const InputBits bits) const { return (_inputState & bits) != 0; }
390 
391  bool isAltDown() const { return _altDown; }
392 
393  void clearInput() {
394  _inputState = kAllUpBits;
395  _inputLocation.x = 0;
396  _inputLocation.y = 0;
397  _altDown = false;
398  }
399 
400 protected:
401  void setInputBits(const InputBits state) { _inputState = state; }
402  void setInputLocation(const Common::Point &where) { _inputLocation = where; }
403  void setAltDown(bool altDown) { _altDown = altDown; }
404 
405  InputBits _inputState;
406  Common::Point _inputLocation;
407  bool _altDown;
408 };
409 
411 public:
412  static InputHandler *setInputHandler(InputHandler*);
413  static InputHandler *getCurrentHandler() { return _inputHandler; }
414  static void pollForInput();
415  static void getInput(Input&, Hotspot*&);
416  static void readInputDevice(Input&);
417  static void invalHotspots() { _invalHotspots = true; }
418  static InputBits getCurrentFilter() { return _lastFilter; }
419 
421  virtual ~InputHandler();
422 
423  virtual void setNextHandler(InputHandler *nextHandler) { _nextHandler = nextHandler; }
424  virtual InputHandler *getNextHandler() { return _nextHandler; }
425 
426  virtual void handleInput(const Input &, const Hotspot *);
427  virtual void clickInHotspot(const Input &, const Hotspot *);
428 
429  virtual void activateHotspots();
430  virtual void updateCursor(const Common::Point, const Hotspot *);
431  virtual bool isClickInput(const Input &, const Hotspot *);
432  virtual bool wantsCursor();
433 
434  virtual bool releaseInputFocus() { return true; }
435  virtual void grabInputFocus() {}
436 
437  // This returns bits set for what kinds of input to accept.
438  virtual InputBits getInputFilter();
439 
440  // This returns bits defining what input constitutes a "click."
441  virtual InputBits getClickFilter();
442 
443  virtual void allowInput(const bool allow) { _allowInput = allow; }
444 
445 protected:
446  static InputHandler *_inputHandler;
447  static bool _invalHotspots;
448  static InputBits _lastFilter;
449 
450  InputHandler *_nextHandler;
451  bool _allowInput;
452 };
453 
454 
455 /*
456 
457  Tracker implements "dragging". A Tracker can receive a startTracking message,
458  which causes it to be the current tracker, as well as setting it up as the current
459  input handler. In addition, only one tracker can be tracking at a time, and no
460  other handler can be set up as the current handler until the track finishes. By
461  default, there is no next input handler for a Tracker, but this behavior can be
462  overridden if desired.
463 
464 */
465 
466 class Tracker : public InputHandler {
467 public:
468  Tracker() : InputHandler(0), _savedHandler(nullptr) {}
469  ~Tracker() override {}
470 
471  void handleInput(const Input &, const Hotspot *) override;
472  virtual bool stopTrackingInput(const Input &) { return false; }
473 
474  virtual void startTracking(const Input &);
475  virtual void stopTracking(const Input &);
476  virtual void continueTracking(const Input &) {}
477 
478  bool isTracking() { return this == _currentTracker; }
479  bool isClickInput(const Input &, const Hotspot *) override;
480 
481  bool releaseInputFocus() override { return !isTracking(); }
482 
483 protected:
484  static Tracker *_currentTracker;
485 
486  InputHandler *_savedHandler;
487 };
488 
489 class JMPPPInput {
490 public:
491  static bool isMenuButtonPressInput(const Input &input) { return input.twoButtonDown(); }
492 
493  static InputBits getClickInputFilter() { return kFilterTwoButton; }
494  static bool isClickInput(const Input &input) { return input.twoButtonDown(); }
495  static bool isDraggingInput(const Input &input) { return input.twoButtonAnyDown(); }
496  static bool isPressingInput(const Input &input) { return input.twoButtonAnyDown(); }
497 
498  static bool isRaiseInventoryInput(const Input &input) { return input.leftFireButtonDown(); }
499  static bool isRaiseBiochipsInput(const Input &input) { return input.rightFireButtonDown(); }
500  static InputBits getItemPanelsInputFilter() { return kFilterFourButton | kFilterLeftFireButton | kFilterRightFireButton; }
501 
502  static bool isToggleAIMiddleInput(const Input &input) { return input.threeButtonDown(); }
503 
504  static bool isToggleInfoInput(const Input &input) { return input.fourButtonDown(); }
505 
506  // Hmmmmm....
507  static bool isEasterEggModifierInput(const Input &input) { return input.isAltDown(); }
508 
509  static bool isTogglePauseInput(const Input &input) { return input.mod3ButtonDown(); }
510 };
511 
512 } // End of namespace Pegasus
513 
514 #define InputDevice (::Pegasus::InputDeviceManager::instance())
515 
516 #endif
Definition: hotspot.h:85
Definition: input.h:466
Definition: input.h:322
Definition: events.h:318
Definition: events.h:199
Definition: rect.h:45
bool notifyEvent(const Common::Event &event) override
Definition: input.h:60
Definition: input.h:489
Definition: input.h:410
Definition: ai_action.h:33
Definition: singleton.h:42