From c0bdbe1ca88967bddd877e14d1e99d3fedaf715e Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 2 Feb 2016 01:55:34 +0100 Subject: 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. --- engines/sci/engine/kevent.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'engines/sci/engine/kevent.cpp') 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); -- cgit v1.2.3