diff options
author | Colin Snover | 2017-07-16 14:19:27 -0500 |
---|---|---|
committer | Colin Snover | 2017-07-16 14:26:30 -0500 |
commit | d8eccdec323dfc1126b87624b73e7effcb2f50bb (patch) | |
tree | 88bfd512586d24ddc8fe1e1e9e9e7b3e27e9cb9d /engines/sci/graphics | |
parent | 63794983033189135746bfd2fc2bc0cbf4e474cb (diff) | |
download | scummvm-rg350-d8eccdec323dfc1126b87624b73e7effcb2f50bb.tar.gz scummvm-rg350-d8eccdec323dfc1126b87624b73e7effcb2f50bb.tar.bz2 scummvm-rg350-d8eccdec323dfc1126b87624b73e7effcb2f50bb.zip |
SCI: Clarify Tab character & modifier workarounds in GfxMenu
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/menu.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 2caad6f8ce..b7030bbea5 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -415,12 +415,6 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { keyPress += 96; } - // If tab got pressed, handle it here as if it was Ctrl-I - at least - // sci0 also did it that way - if (keyPress == SCI_KEY_TAB) { - keyModifier = SCI_KEYMOD_CTRL; - keyPress = 'i'; - } switch (keyPress) { case 0: break; @@ -433,12 +427,25 @@ 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) + + // Tab and Ctrl+I share the same ASCII character, but this + // method also checks the modifier (whereas SSCI looked only at + // the character), so a Tab keypress must be converted here + // to Ctrl+I or the modifier check will fail and the Tab key + // won't do anything. (This is also why Ctrl+I and Ctrl+Shift+I + // would both bring up the inventory in SSCI QFG1EGA) + if (keyPress == SCI_KEY_TAB) { + keyModifier = SCI_KEYMOD_CTRL; + keyPress = 'i'; + } + + // We need to isolate the lower byte when checking modifiers + // because of a keyboard driver bug (see engine/kevent.cpp / + // kGetEvent) + keyModifier &= 0xFF; + if (itemEntry->keyPress == keyPress && - itemEntry->keyModifier == (keyModifier & 0xFF) && + itemEntry->keyModifier == keyModifier && itemEntry->enabled) break; itemIterator++; |