[Scummvm-git-logs] scummvm master -> b4c0be8b42d63cbf3c808be1a94839483f674ce9

csnover csnover at users.noreply.github.com
Sun Jul 16 08:39:49 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b4c0be8b42 SCI: Fix control character keyboard events


Commit: b4c0be8b42d63cbf3c808be1a94839483f674ce9
    https://github.com/scummvm/scummvm/commit/b4c0be8b42d63cbf3c808be1a94839483f674ce9
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-16T01:33:57-05:00

Commit Message:
SCI: Fix control character keyboard events

Used by:

* All games with text inputs (Ctrl+C clears text boxes)
* QFG1VGA (Ctrl+S shows stats)
* Torin (Ctrl+N, Ctrl+O, Ctrl+S, etc. activate menu commands)

The branch that used to shift control keys for SCI versions <=
SCI_VERSION_1_MIDDLE was bogus; history indicates it was intended
to be used to fix backends that sent control characters when
Ctrl+Alt were used together, but that case is already handled by
the Alt-checking code just prior to that code. Games expect to
receive control characters only when Ctrl is the only active
modifier, and this seems to be consistent across all versions of
SCI engine from SCI0 all the way through at least SCI2.1.

Fixes Trac#6703, Trac#9837.

Changed paths:
    engines/sci/event.cpp


diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index e365296..873b6bb 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -335,13 +335,13 @@ SciEvent EventManager::getScummVMEvent() {
 	// Scancodify if appropriate
 	if (scummVMKeyFlags & Common::KBD_ALT)
 		input.character = altify(input.character);
-	if (getSciVersion() <= SCI_VERSION_1_MIDDLE && (scummVMKeyFlags & Common::KBD_CTRL) && input.character > 0 && input.character < 27)
-		input.character += 96; // 0x01 -> 'a'
-#ifdef ENABLE_SCI32
-	if (getSciVersion() >= SCI_VERSION_2 && (scummVMKeyFlags & Common::KBD_CTRL) && input.character == 'c') {
-		input.character = SCI_KEY_ETX;
+
+	// In SSCI, Ctrl+<key> generates ASCII control characters, but the backends
+	// usually give us a latin character + Ctrl flag, so convert this combo back
+	// into what is expected by game scripts
+	if ((scummVMKeyFlags & Common::KBD_NON_STICKY) == Common::KBD_CTRL && input.character >= 'a' && input.character <= 'z') {
+		input.character -= 96;
 	}
-#endif
 
 	// If no actual key was pressed (e.g. if only a modifier key was pressed),
 	// ignore the event





More information about the Scummvm-git-logs mailing list