aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2009-12-04 13:49:43 +0000
committerMartin Kiewitz2009-12-04 13:49:43 +0000
commitdde874392354ac625ccb61409053095bf39204df (patch)
treeac82f0a9f40032dac9b397b23cc32591f1d2f4f9 /engines/sci
parent43abd8d2e9f1e6dee97052397d7dddc6f028ff46 (diff)
downloadscummvm-rg350-dde874392354ac625ccb61409053095bf39204df.tar.gz
scummvm-rg350-dde874392354ac625ccb61409053095bf39204df.tar.bz2
scummvm-rg350-dde874392354ac625ccb61409053095bf39204df.zip
SCI: Convert characters to scancode, when Ctrl is pressed (fixes key-shortcuts not working in lsl5, lsl1, qfg1vga and others)
svn-id: r46249
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kevent.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 34fba22de1..8af8bea54c 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -85,9 +85,16 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
} else {
PUT_SEL32V(segMan, obj, type, SCI_EVT_KEYBOARD); // Keyboard event
s->r_acc = make_reg(0, 1);
+
+ if (e.buckybits == SCI_EVM_CTRL) {
+ // If Control is pressed, we need to convert the actual key to a DOS scancode
+ if ((e.character >= 97) && (e.character <= 121)) {
+ e.character -= 96; // 'a' -> 0x01, etc.
+ }
+ }
+
PUT_SEL32V(segMan, obj, message, e.character);
- // We only care about the translated
- // character
+ // We only care about the translated character
PUT_SEL32V(segMan, obj, modifiers, e.buckybits&modifier_mask);
}
break;