aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorColin Snover2017-09-26 00:45:17 -0500
committerColin Snover2017-09-27 20:27:34 -0500
commit7a41b6f023e31a5f6845b9a256d966270fa60151 (patch)
treec295dccf350d9417bfee99317b185ca6164d840a /engines/sci/engine
parent4bd31dae9b638bb6c80ddc3db7b41f34c68626fc (diff)
downloadscummvm-rg350-7a41b6f023e31a5f6845b9a256d966270fa60151.tar.gz
scummvm-rg350-7a41b6f023e31a5f6845b9a256d966270fa60151.tar.bz2
scummvm-rg350-7a41b6f023e31a5f6845b9a256d966270fa60151.zip
SCI: Add support for keyup events
Basic keyup event support appears to have been added in the SCI1.1 IBM keyboard driver, and more robust support was provided in SCI32 which actually gets used by at least Lighthouse. This patch adds support for keyup events in SCI1.1+. Fixes Trac#10242.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kevent.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 0f77b47640..608e2e4ce9 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -58,6 +58,8 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
// If there's a simkey pending, and the game wants a keyboard event, use the
// simkey instead of a normal event
+ // TODO: This does not really work as expected for keyup events, since the
+ // fake event is disposed halfway through the normal event lifecycle.
if (g_debug_simulated_key && (mask & kSciEventKeyDown)) {
// In case we use a simulated event we query the current mouse position
mousePos = g_sci->_gfxCursor->getPosition();
@@ -180,6 +182,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
break;
case kSciEventKeyDown:
+ case kSciEventKeyUp:
writeSelectorValue(segMan, obj, SELECTOR(type), curEvent.type);
writeSelectorValue(segMan, obj, SELECTOR(message), curEvent.character);
// We only care about the translated character
@@ -230,6 +233,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
con->debugPrintf("quit event\n");
break;
case kSciEventKeyDown:
+ case kSciEventKeyUp:
con->debugPrintf("keyboard event\n");
break;
case kSciEventMousePress: