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 /engines/sci/graphics | |
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
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/controls.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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 |