From dde874392354ac625ccb61409053095bf39204df Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 4 Dec 2009 13:49:43 +0000 Subject: SCI: Convert characters to scancode, when Ctrl is pressed (fixes key-shortcuts not working in lsl5, lsl1, qfg1vga and others) svn-id: r46249 --- engines/sci/engine/kevent.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/sci') 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; -- cgit v1.2.3