diff options
author | David Corrales | 2007-06-23 18:51:33 +0000 |
---|---|---|
committer | David Corrales | 2007-06-23 18:51:33 +0000 |
commit | cacd7a28fd51d960947de88abbf30c487e66529d (patch) | |
tree | f3baa59853bfb307e452b86b9d93c4737b1fa6ab /engines/queen | |
parent | 0ac96302fe9c04df79cb01a77d19535b45fe2db0 (diff) | |
parent | 90c2210dae8c91fa8babc6b05564e15c9d445d18 (diff) | |
download | scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.tar.gz scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.tar.bz2 scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.zip |
Merged the FSNode branch with trunk r27031:27680
svn-id: r27681
Diffstat (limited to 'engines/queen')
-rw-r--r-- | engines/queen/input.cpp | 32 | ||||
-rw-r--r-- | engines/queen/input.h | 29 | ||||
-rw-r--r-- | engines/queen/journal.cpp | 6 |
3 files changed, 21 insertions, 46 deletions
diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp index 5154b04dbe..10a8664c0e 100644 --- a/engines/queen/input.cpp +++ b/engines/queen/input.cpp @@ -55,7 +55,7 @@ Input::Input(Common::Language language, OSystem *system) : _system(system), _eventMan(system->getEventManager()), _fastMode(false), _keyVerb(VERB_NONE), _cutawayRunning(false), _canQuit(false), _cutawayQuit(false), _dialogueRunning(false), _talkQuit(false), - _quickSave(false), _quickLoad(false), _debugger(false), _inKey(0), + _quickSave(false), _quickLoad(false), _debugger(false), _inKey(Common::KEYCODE_INVALID), _mouseButton(0), _idleTime(0) { switch (language) { @@ -135,34 +135,34 @@ void Input::delay(uint amount) { } while (_system->getMillis() < end); } -int Input::checkKeys() { +void Input::checkKeys() { if (_inKey) debug(6, "[Input::checkKeys] _inKey = %i", _inKey); switch (_inKey) { - case KEY_SPACE: + case Common::KEYCODE_SPACE: _keyVerb = VERB_SKIP_TEXT; break; - case KEY_COMMA: + case Common::KEYCODE_COMMA: _keyVerb = VERB_SCROLL_UP; break; - case KEY_DOT: + case Common::KEYCODE_PERIOD: _keyVerb = VERB_SCROLL_DOWN; break; - case KEY_DIGIT_1: + case Common::KEYCODE_1: _keyVerb = VERB_DIGIT_1; break; - case KEY_DIGIT_2: + case Common::KEYCODE_2: _keyVerb = VERB_DIGIT_2; break; - case KEY_DIGIT_3: + case Common::KEYCODE_3: _keyVerb = VERB_DIGIT_3; break; - case KEY_DIGIT_4: + case Common::KEYCODE_4: _keyVerb = VERB_DIGIT_4; break; - case KEY_ESCAPE: // skip cutaway / dialogue + case Common::KEYCODE_ESCAPE: // skip cutaway / dialogue if (_canQuit) { if (_cutawayRunning) { debug(6, "[Input::checkKeys] Setting _cutawayQuit to true"); @@ -172,8 +172,8 @@ int Input::checkKeys() { _talkQuit = true; } break; - case KEY_F1: // use Journal - case KEY_F5: + case Common::KEYCODE_F1: // use Journal + case Common::KEYCODE_F5: if (_cutawayRunning) { if (_canQuit) { _keyVerb = VERB_USE_JOURNAL; @@ -185,10 +185,10 @@ int Input::checkKeys() { _talkQuit = true; } break; - case KEY_F11: // quicksave + case Common::KEYCODE_F11: // quicksave _quickSave = true; break; - case KEY_F12: // quickload + case Common::KEYCODE_F12: // quickload _quickLoad = true; break; default: @@ -201,9 +201,7 @@ int Input::checkKeys() { break; } - int inKey = _inKey; - _inKey = 0; // reset - return inKey; + _inKey = Common::KEYCODE_INVALID; // reset } Common::Point Input::getMousePos() const { diff --git a/engines/queen/input.h b/engines/queen/input.h index 9afb7472b1..86092aeed6 100644 --- a/engines/queen/input.h +++ b/engines/queen/input.h @@ -28,14 +28,11 @@ #include "common/util.h" #include "common/rect.h" +#include "common/events.h" #include "queen/defs.h" class OSystem; -namespace Common { - class EventManager; -} - namespace Queen { class Input { @@ -57,7 +54,7 @@ public: void delay(uint amount); //! convert input to verb - int checkKeys(); + void checkKeys(); //! use instead of KEYVERB=0 void clearKeyVerb() { _keyVerb = VERB_NONE; } @@ -97,26 +94,6 @@ public: private: - enum KeyCode { - KEY_SPACE = ' ', - KEY_COMMA = ',', - KEY_DOT = '.', - - KEY_DIGIT_1 = '1', - KEY_DIGIT_2 = '2', - KEY_DIGIT_3 = '3', - KEY_DIGIT_4 = '4', - - KEY_ESCAPE = 27, - KEY_RETURN = 13, - KEY_BACKSPACE = 8, - - KEY_F1 = 282, - KEY_F11 = KEY_F1 + 10, - KEY_F5 = KEY_F1 + 4, - KEY_F12 - }; - //! used to get keyboard and mouse events OSystem *_system; @@ -153,7 +130,7 @@ private: bool _debugger; //! set by delay(); - int _inKey; + Common::KeyCode _inKey; //! set by delay(); int _mouseButton; diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp index 3db7ce82f0..c75b03a5c0 100644 --- a/engines/queen/journal.cpp +++ b/engines/queen/journal.cpp @@ -515,15 +515,15 @@ void Journal::initTextField(const char *desc) { void Journal::updateTextField(uint16 ascii, int keycode) { bool dirty = false; switch (keycode) { - case 8: // backspace + case Common::KEYCODE_BACKSPACE: if (_textField.textCharsCount > 0) { --_textField.textCharsCount; _textField.text[_textField.textCharsCount] = '\0'; dirty = true; } break; - case '\n': - case '\r': + case Common::KEYCODE_RETURN: + case Common::KEYCODE_KP_ENTER: if (_textField.text[0]) { closeTextField(); int currentSlot = _currentSavePage * 10 + _currentSaveSlot; |