[Scummvm-cvs-logs] SF.net SVN: scummvm:[52252] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Aug 21 12:46:36 CEST 2010
Revision: 52252
http://scummvm.svn.sourceforge.net/scummvm/?rev=52252&view=rev
Author: thebluegr
Date: 2010-08-21 10:46:35 +0000 (Sat, 21 Aug 2010)
Log Message:
-----------
SCI: Fixed bug #3048911 - "Keyboard discrepancies in all SCI games" by handling synthetic (keyboard repeat) events and adding support for Control-C
Modified Paths:
--------------
scummvm/trunk/engines/sci/event.cpp
scummvm/trunk/engines/sci/graphics/controls.cpp
Modified: scummvm/trunk/engines/sci/event.cpp
===================================================================
--- scummvm/trunk/engines/sci/event.cpp 2010-08-21 09:19:34 UTC (rev 52251)
+++ scummvm/trunk/engines/sci/event.cpp 2010-08-21 10:46:35 UTC (rev 52252)
@@ -149,7 +149,7 @@
found = em->pollEvent(ev);
}
- if (found && !ev.synthetic && ev.type != Common::EVENT_MOUSEMOVE) {
+ if (found && ev.type != Common::EVENT_MOUSEMOVE) {
int modifiers = em->getModifierState();
// We add the modifier key status to buckybits
Modified: scummvm/trunk/engines/sci/graphics/controls.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/controls.cpp 2010-08-21 09:19:34 UTC (rev 52251)
+++ scummvm/trunk/engines/sci/graphics/controls.cpp 2010-08-21 10:46:35 UTC (rev 52252)
@@ -150,7 +150,7 @@
uint16 maxChars = readSelectorValue(_segMan, controlObject, SELECTOR(max));
reg_t textReference = readSelector(_segMan, controlObject, SELECTOR(text));
Common::String text;
- uint16 textSize, eventType, eventKey = 0;
+ uint16 textSize, eventType, eventKey = 0, modifiers = 0;
bool textChanged = false;
bool textAddChar = false;
Common::Rect rect;
@@ -169,6 +169,7 @@
break;
case SCI_EVENT_KEYBOARD:
eventKey = readSelectorValue(_segMan, eventObject, SELECTOR(message));
+ modifiers = readSelectorValue(_segMan, eventObject, SELECTOR(modifiers));
switch (eventKey) {
case SCI_KEY_BACKSPACE:
if (cursorPos > 0) {
@@ -196,6 +197,13 @@
cursorPos++; textChanged = true;
}
break;
+ case 3: // a bit odd, but this is what is returned when Control - C is pressed
+ if (modifiers & SCI_KEYMOD_CTRL) {
+ // Control-C erases the whole line
+ cursorPos = 0; text.clear();
+ textChanged = true;
+ }
+ break;
default:
if (eventKey > 31 && eventKey < 256 && textSize < maxChars) {
// insert pressed character
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list