diff options
| author | Filippos Karapetis | 2010-08-21 10:46:35 +0000 | 
|---|---|---|
| committer | Filippos Karapetis | 2010-08-21 10:46:35 +0000 | 
| commit | dcd6c9eaf0129fe804f50534aed7dc6eafdaf2bd (patch) | |
| tree | 48157f2d3be1b7c612bf997e87df10a43b988271 | |
| parent | 107c39910da802c10498501139b545e71cd94daf (diff) | |
| download | scummvm-rg350-dcd6c9eaf0129fe804f50534aed7dc6eafdaf2bd.tar.gz scummvm-rg350-dcd6c9eaf0129fe804f50534aed7dc6eafdaf2bd.tar.bz2 scummvm-rg350-dcd6c9eaf0129fe804f50534aed7dc6eafdaf2bd.zip | |
SCI: Fixed bug #3048911 - "Keyboard discrepancies in all SCI games" by handling synthetic (keyboard repeat) events and adding support for Control-C
svn-id: r52252
| -rw-r--r-- | engines/sci/event.cpp | 2 | ||||
| -rw-r--r-- | engines/sci/graphics/controls.cpp | 10 | 
2 files changed, 10 insertions, 2 deletions
| diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 5923e501cf..3234ab68ff 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -149,7 +149,7 @@ SciEvent EventManager::getScummVMEvent() {  		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 diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls.cpp index 5891413be8..6cdf2e4e9d 100644 --- a/engines/sci/graphics/controls.cpp +++ b/engines/sci/graphics/controls.cpp @@ -150,7 +150,7 @@ void GfxControls::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {  	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 @@ void GfxControls::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {  			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 @@ void GfxControls::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {  					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 | 
