diff options
author | Martin Kiewitz | 2016-02-02 01:55:34 +0100 |
---|---|---|
committer | Martin Kiewitz | 2016-02-02 01:56:08 +0100 |
commit | c0bdbe1ca88967bddd877e14d1e99d3fedaf715e (patch) | |
tree | 8a7ec7b01f806f1b4b2ea61cb3aa5662e27485cb /engines/sci/graphics | |
parent | 727ba4f2b1f20173e7a7f5ab6cb2910382785fe9 (diff) | |
download | scummvm-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/graphics')
-rw-r--r-- | engines/sci/graphics/menu.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 8e8c1d64c2..9d92039111 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -424,8 +424,12 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { default: while (itemIterator != itemEnd) { itemEntry = *itemIterator; + // Sierra actually did not check the modifier, they only checked the ascii code + // Which is why for example pressing Ctrl-I and Shift-Ctrl-I both brought up the inventory in QfG1 + // We still check the modifier, but we need to isolate the lower byte, because of a keyboard + // driver bug (see engine/kevent.cpp / kGetEvent) if (itemEntry->keyPress == keyPress && - itemEntry->keyModifier == keyModifier && + itemEntry->keyModifier == (keyModifier & 0xFF) && itemEntry->enabled) break; itemIterator++; |