aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kevent.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-02 01:55:34 +0100
committerMartin Kiewitz2016-02-02 01:56:08 +0100
commitc0bdbe1ca88967bddd877e14d1e99d3fedaf715e (patch)
tree8a7ec7b01f806f1b4b2ea61cb3aa5662e27485cb /engines/sci/engine/kevent.cpp
parent727ba4f2b1f20173e7a7f5ab6cb2910382785fe9 (diff)
downloadscummvm-rg350-c0bdbe1ca88967bddd877e14d1e99d3fedaf715e.tar.gz
scummvm-rg350-c0bdbe1ca88967bddd877e14d1e99d3fedaf715e.tar.bz2
scummvm-rg350-c0bdbe1ca88967bddd877e14d1e99d3fedaf715e.zip
SCI: Fix control/Fx keys not working anymore
Was effectively caused by commit adding the keyboard driver bug for SCI0/SCI01, although the bug is actually real and happens. It seems Sierra did not check the key-modifier in kMenuSelect. We do and that's why the code didn't recognize all sorts of menu keys anymore. We now isolate the lower byte before comparing. I also noticed, that Sierra passed keyboard modifiers in mouse events. This was probably done, so that owners of a 1-button mouse were able to right-click. We do this now too. Also added information about mouse modifiers in kGetEvent. Moved the mouse modifier code into getScummVMEvent(). This should fix bug #7009.
Diffstat (limited to 'engines/sci/engine/kevent.cpp')
-rw-r--r--engines/sci/engine/kevent.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index beaad2628a..0e5cd7ae12 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -126,13 +126,13 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
// It seems Sierra fixed this behaviour (effectively bug) in the SCI1 keyboard driver.
// SCI32 also resets the upper byte.
+
+ // This was verified in SSCI itself by creating a SCI game and checking behavior.
if (getSciVersion() <= SCI_VERSION_01) {
modifiers |= 0x0200;
}
}
- //s->_gui->moveCursor(s->gfx_state->pointer_pos.x, s->gfx_state->pointer_pos.y);
-
switch (curEvent.type) {
case SCI_EVENT_QUIT:
s->abortScriptProcessing = kAbortQuitGame; // Terminate VM
@@ -151,7 +151,6 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
case SCI_EVENT_MOUSE_RELEASE:
case SCI_EVENT_MOUSE_PRESS:
-
// track left buttton clicks, if requested
if (curEvent.type == SCI_EVENT_MOUSE_PRESS && curEvent.data == 1 && g_debug_track_mouse_clicks) {
g_sci->getSciDebugger()->debugPrintf("Mouse clicked at %d, %d\n",
@@ -159,19 +158,6 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
}
if (mask & curEvent.type) {
- int extra_bits = 0;
-
- switch (curEvent.data) {
- case 2:
- extra_bits = SCI_KEYMOD_LSHIFT | SCI_KEYMOD_RSHIFT;
- break;
- case 3:
- extra_bits = SCI_KEYMOD_CTRL;
- default:
- break;
- }
- modifiers |= extra_bits; // add these additional bits to the mix
-
writeSelectorValue(segMan, obj, SELECTOR(type), curEvent.type);
writeSelectorValue(segMan, obj, SELECTOR(message), 0);
writeSelectorValue(segMan, obj, SELECTOR(modifiers), modifiers);