aboutsummaryrefslogtreecommitdiff
path: root/queen/input.cpp
diff options
context:
space:
mode:
authorDavid Eriksson2003-11-02 20:42:36 +0000
committerDavid Eriksson2003-11-02 20:42:36 +0000
commit3ca74e5d4a1a30b2fb38e8c7d12794ea3cb9c247 (patch)
tree70457c0f8908f0c235944b247981c28c60bba305 /queen/input.cpp
parentaf19319a246100cf1164538589389258f8409d43 (diff)
downloadscummvm-rg350-3ca74e5d4a1a30b2fb38e8c7d12794ea3cb9c247.tar.gz
scummvm-rg350-3ca74e5d4a1a30b2fb38e8c7d12794ea3cb9c247.tar.bz2
scummvm-rg350-3ca74e5d4a1a30b2fb38e8c7d12794ea3cb9c247.zip
Enable keys for panel commands.
svn-id: r11063
Diffstat (limited to 'queen/input.cpp')
-rw-r--r--queen/input.cpp52
1 files changed, 50 insertions, 2 deletions
diff --git a/queen/input.cpp b/queen/input.cpp
index 2a692d4e9a..ebeb394671 100644
--- a/queen/input.cpp
+++ b/queen/input.cpp
@@ -26,11 +26,43 @@
namespace Queen {
-
-Input::Input(OSystem *system) :
+const char* Input::_commandKeys[LANGUAGE_COUNT] = {
+ { "ocmglptu" }, // English
+ { "osbgpnre" }, // German
+ { "ofdnepau" }, // French
+ { "acsdgpqu" }, // Italian
+ { "ocmglptu" }, // Hebrew
+ { "acodmthu" } // Spanish
+};
+
+Input::Input(Language language, OSystem *system) :
_system(system), _fastMode(false), _keyVerb(VERB_NONE),
_cutawayRunning(false), _cutawayQuit(false), _talkQuit(false),
_inKey(0), _mouse_x(0), _mouse_y(0), _mouseButton(0) {
+
+ switch (language) {
+ case ENGLISH:
+ _currentCommandKeys = _commandKeys[0];
+ break;
+ case GERMAN:
+ _currentCommandKeys = _commandKeys[1];
+ break;
+ case FRENCH:
+ _currentCommandKeys = _commandKeys[2];
+ break;
+ case ITALIAN:
+ _currentCommandKeys = _commandKeys[3];
+ break;
+ case HEBREW:
+ _currentCommandKeys = _commandKeys[4];
+ break;
+ case SPANISH:
+ _currentCommandKeys = _commandKeys[5];
+ break;
+ default:
+ error("Unknown language");
+ break;
+ }
}
void Input::delay() {
@@ -155,6 +187,22 @@ void Input::checkKeys() {
break;
default:
+ if(_inKey == _currentCommandKeys[0])
+ _keyVerb = Verb(VERB_OPEN);
+ else if(_inKey == _currentCommandKeys[1])
+ _keyVerb = Verb(VERB_CLOSE);
+ else if(_inKey == _currentCommandKeys[2])
+ _keyVerb = Verb(VERB_MOVE);
+ else if(_inKey == _currentCommandKeys[3])
+ _keyVerb = Verb(VERB_GIVE);
+ else if(_inKey == _currentCommandKeys[4])
+ _keyVerb = Verb(VERB_LOOK_AT);
+ else if(_inKey == _currentCommandKeys[5])
+ _keyVerb = Verb(VERB_PICK_UP);
+ else if(_inKey == _currentCommandKeys[6])
+ _keyVerb = Verb(VERB_TALK_TO);
+ else if(_inKey == _currentCommandKeys[7])
+ _keyVerb = Verb(VERB_USE);
break;
}