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 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (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, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef QUEEN_INPUT_H 24 #define QUEEN_INPUT_H 25 26 #include "common/language.h" 27 #include "common/rect.h" 28 #include "common/events.h" 29 #include "queen/defs.h" 30 31 class OSystem; 32 33 namespace Queen { 34 35 class Input { 36 public: 37 38 //! Adjust here to change delays! 39 enum { 40 DELAY_SHORT = 10, 41 DELAY_NORMAL = 100, // 5 * 20ms 42 DELAY_SCREEN_BLANKER = 5 * 60 * 1000 43 }; 44 enum { 45 MOUSE_LBUTTON = 1, 46 MOUSE_RBUTTON = 2 47 }; 48 49 Input(Common::Language language, OSystem *system); 50 51 void delay(uint amount); 52 53 //! convert input to verb 54 void checkKeys(); 55 56 //! use instead of KEYVERB=0 clearKeyVerb()57 void clearKeyVerb() { _keyVerb = VERB_NONE; } 58 canQuit(bool cq)59 void canQuit(bool cq) { _canQuit = cq; } 60 cutawayRunning()61 bool cutawayRunning() const { return _cutawayRunning; } cutawayRunning(bool running)62 void cutawayRunning(bool running) { _cutawayRunning = running; } 63 cutawayQuit()64 bool cutawayQuit() const { return _cutawayQuit; } cutawayQuitReset()65 void cutawayQuitReset() { _cutawayQuit = false; } 66 dialogueRunning(bool running)67 void dialogueRunning(bool running) { _dialogueRunning = running; } 68 talkQuit()69 bool talkQuit() const { return _talkQuit; } talkQuitReset()70 void talkQuitReset() { _talkQuit = false; } 71 quickSave()72 bool quickSave() const { return _quickSave; } quickSaveReset()73 void quickSaveReset() { _quickSave = false; } quickLoad()74 bool quickLoad() const { return _quickLoad; } quickLoadReset()75 void quickLoadReset() { _quickLoad = false; } debugger()76 bool debugger() const { return _debugger; } debuggerReset()77 void debuggerReset() { _debugger = false; } 78 fastMode()79 bool fastMode() const { return _fastMode; } fastMode(bool fm)80 void fastMode(bool fm) { _fastMode = fm; } 81 keyVerb()82 Verb keyVerb() const { return _keyVerb; } 83 84 Common::Point getMousePos() const; 85 mouseButton()86 int mouseButton() const { return _mouseButton; } clearMouseButton()87 void clearMouseButton() { _mouseButton = 0; } 88 89 //! returns user idle time (used by Display, to trigger the screensaver) idleTime()90 uint32 idleTime() const { return _idleTime; } 91 92 private: 93 94 //! used to get keyboard and mouse events 95 OSystem *_system; 96 97 Common::EventManager *_eventMan; 98 99 //! some cutaways require update() run faster 100 bool _fastMode; 101 102 //! the current verb received from keyboard 103 Verb _keyVerb; 104 105 //! set if a cutaway is running 106 bool _cutawayRunning; 107 108 //! set this if we can quit 109 bool _canQuit; 110 111 //! moved Cutaway::_quit here 112 bool _cutawayQuit; 113 114 //! set if a dialogue is running 115 bool _dialogueRunning; 116 117 //! moved Talk::_quit here 118 bool _talkQuit; 119 120 //! set if quicksave requested 121 bool _quickSave; 122 123 //! set if quickload requested 124 bool _quickLoad; 125 126 //! set if debugger requested 127 bool _debugger; 128 129 //! set by delay(); 130 Common::KeyCode _inKey; 131 132 //! set by delay(); 133 int _mouseButton; 134 135 //! user idle time 136 uint32 _idleTime; 137 138 //! command keys for current language 139 const char *_currentCommandKeys; 140 141 //! command keys for all languages 142 static const char *const _commandKeys[]; 143 144 //! verbs matching the command keys 145 static const Verb _verbKeys[]; 146 }; 147 148 } // End of namespace Queen 149 150 #endif 151