diff options
author | Max Horn | 2007-06-30 11:57:50 +0000 |
---|---|---|
committer | Max Horn | 2007-06-30 11:57:50 +0000 |
commit | 252d18329168bfdfd141a0dbaa07175f2cb2b1c8 (patch) | |
tree | 10f53e291b34c9274ce23ad8cd9aa63d9c3b4929 /engines/scumm | |
parent | dd77f8e1537272c395f99585edbc13153a1589d3 (diff) | |
download | scummvm-rg350-252d18329168bfdfd141a0dbaa07175f2cb2b1c8.tar.gz scummvm-rg350-252d18329168bfdfd141a0dbaa07175f2cb2b1c8.tar.bz2 scummvm-rg350-252d18329168bfdfd141a0dbaa07175f2cb2b1c8.zip |
SCUMM: Moved code which re-mapped arrow keys
svn-id: r27783
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/input.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index a802ea1c96..05a9a8115a 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -89,22 +89,6 @@ void ScummEngine::parseEvents() { _keyPressed = event.kbd; } - if (event.kbd.keycode >= Common::KEYCODE_UP && event.kbd.keycode <= Common::KEYCODE_LEFT) { - if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD) { - _keyPressed = event.kbd; - _keyPressed.ascii = event.kbd.ascii - Common::KEYCODE_UP + 54; - } else if (_game.version < 7) { - // FIXME: Handle this specific property inside processKeyboard ? - - // Don't let game see arrow keys. This fixes bug with up arrow (273) - // corresponding to the "instant win" cheat in MI2 mentioned above. - // - // This is not applicable to V7+ games, which need to see the arrow keys, - // too, else certain things (derby scene, asterorid lander) won't work. - _keyPressed.reset(); - } - } - if (_game.heversion >= 80) { // Keyboard is controlled via variable int keyState = 0; @@ -556,13 +540,26 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) { VAR(VAR_CHARINC) = _defaultTalkDelay; } else { - // FIXME: Possibly convert even more keycode/ascii pairs to their SCUMM counterparts? + if (lastKeyHit.keycode >= Common::KEYCODE_F1 && lastKeyHit.keycode <= Common::KEYCODE_F9) { _mouseAndKeyboardStat = lastKeyHit.keycode - Common::KEYCODE_F1 + 315; } else if (_game.id == GID_MONKEY2 && (lastKeyHit.flags & Common::KBD_ALT)) { // Handle KBD_ALT combos in MI2. We know that the result must be 273 for Alt-W // because that's what MI2 looks for in its "instant win" cheat. _mouseAndKeyboardStat = lastKeyHit.keycode + 154; + } else if (lastKeyHit.keycode >= Common::KEYCODE_UP && lastKeyHit.keycode <= Common::KEYCODE_LEFT) { + if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD) { + // Map arrow keys to number keys in the SEGA version of MI to support + // scrolling to conversation choices. + _mouseAndKeyboardStat = lastKeyHit.keycode - Common::KEYCODE_UP + 54; + } else if (_game.version >= 7) { + // Don't let pre-V7 game see arrow keys. This fixes bug with up arrow (273) + // corresponding to the "instant win" cheat in MI2 mentioned above. + // + // This is not applicable to V7+ games, which need to see the arrow keys, + // too, else certain things (derby scene, asterorid lander) won't work. + _mouseAndKeyboardStat = lastKeyHit.ascii; + } } else { _mouseAndKeyboardStat = lastKeyHit.ascii; } |