aboutsummaryrefslogtreecommitdiff
path: root/scumm/input.cpp
diff options
context:
space:
mode:
authorTravis Howell2004-10-18 06:40:36 +0000
committerTravis Howell2004-10-18 06:40:36 +0000
commit1922b330adeb553dc7f02fa93f2faa5328f176c3 (patch)
tree10068acf0a772459f3dff4ee4d0350de6e67bead /scumm/input.cpp
parenta6da7109238d4bf70c51276d83cb2067f053417e (diff)
downloadscummvm-rg350-1922b330adeb553dc7f02fa93f2faa5328f176c3.tar.gz
scummvm-rg350-1922b330adeb553dc7f02fa93f2faa5328f176c3.tar.bz2
scummvm-rg350-1922b330adeb553dc7f02fa93f2faa5328f176c3.zip
Add keyboard control for HE80+ games.
svn-id: r15604
Diffstat (limited to 'scumm/input.cpp')
-rw-r--r--scumm/input.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/scumm/input.cpp b/scumm/input.cpp
index b8b10b975f..c8a33cbcc4 100644
--- a/scumm/input.cpp
+++ b/scumm/input.cpp
@@ -97,6 +97,31 @@ void ScummEngine::parseEvents() {
_keyPressed = event.kbd.ascii; // Normal key press, pass on to the game.
}
+ if (_heversion >= 80) {
+ // Keyboard is controlled via variable
+ int _keyState = 0;
+
+ if (event.kbd.ascii == 276) // Left
+ _keyState = 1;
+
+ if (event.kbd.ascii == 275) // Right
+ _keyState |= 2;
+
+ if (event.kbd.ascii == 273) // Up
+ _keyState |= 4;
+
+ if (event.kbd.ascii == 274) // Down
+ _keyState |= 8;
+
+ if (event.kbd.flags == OSystem::KBD_SHIFT)
+ _keyState |= 16;
+
+ if (event.kbd.flags == OSystem::KBD_CTRL)
+ _keyState |= 32;
+
+ VAR(VAR_KEY_STATE) = _keyState;
+ }
+
if (_keyPressed >= 512)
debugC(DEBUG_GENERAL, "_keyPressed > 512 (%d)", _keyPressed);
else