aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-06-22 20:51:37 +0000
committerMax Horn2007-06-22 20:51:37 +0000
commite8a4d396fe08cde375c9193a4dbb8847f663e774 (patch)
tree20a9822913978c8368a9aab5908bc0465ed8e778
parent85bf0f6d6b03097290fbcbc18357756c048f8a8f (diff)
downloadscummvm-rg350-e8a4d396fe08cde375c9193a4dbb8847f663e774.tar.gz
scummvm-rg350-e8a4d396fe08cde375c9193a4dbb8847f663e774.tar.bz2
scummvm-rg350-e8a4d396fe08cde375c9193a4dbb8847f663e774.zip
Get rid of FOTAQ's own KeyCode enum in favor of Common::KeyCode (attention: the F12 quickload hotkey used to be incorrectly mapped to F6, this change 'fixes' that)
svn-id: r27623
-rw-r--r--engines/queen/input.cpp32
-rw-r--r--engines/queen/input.h29
2 files changed, 18 insertions, 43 deletions
diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp
index 5154b04dbe..7775988766 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_INALID),
_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_INALID; // 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;