diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/event.h | 1 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/engines/sci/event.h b/engines/sci/event.h index 23b59f964a..3b18db2f92 100644 --- a/engines/sci/event.h +++ b/engines/sci/event.h @@ -127,6 +127,7 @@ struct SciEvent { #define SCI_KEYMOD_CAPSLOCK (1 << 6) #define SCI_KEYMOD_INSERT (1 << 7) +#define SCI_KEYMOD_NON_STICKY (SCI_KEYMOD_RSHIFT | SCI_KEYMOD_LSHIFT | SCI_KEYMOD_CTRL | SCI_KEYMOD_ALT) #define SCI_KEYMOD_NO_FOOLOCK (~(SCI_KEYMOD_SCRLOCK | SCI_KEYMOD_NUMLOCK | SCI_KEYMOD_CAPSLOCK | SCI_KEYMOD_INSERT)) #define SCI_KEYMOD_ALL 0xFF diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index eb3f5888c7..2caad6f8ce 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -406,6 +406,15 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { case SCI_EVENT_KEYBOARD: keyPress = readSelectorValue(_segMan, eventObject, SELECTOR(message)); keyModifier = readSelectorValue(_segMan, eventObject, SELECTOR(modifiers)); + + // ASCII control characters are put in the `message` field when + // Ctrl+<key> is pressed, but this kMenuSelect implementation matches + // on modifier + printable character, so we must convert the control + // characters to their lower-case latin printed equivalents + if ((keyModifier & SCI_KEYMOD_NON_STICKY) == SCI_KEYMOD_CTRL && keyPress > 0 && keyPress < 27) { + 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) { |