aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/controls16.cpp
diff options
context:
space:
mode:
authorColin Snover2017-09-25 20:51:10 -0500
committerColin Snover2017-09-27 20:27:33 -0500
commit9a8070da3c533dd4885e8044051a5e1a9caac9bb (patch)
treef2ade382b357b7f9e66b7cae288023820ca670b6 /engines/sci/graphics/controls16.cpp
parentc88d5519c2e2672ce7faabfa52f36af4a8706cba (diff)
downloadscummvm-rg350-9a8070da3c533dd4885e8044051a5e1a9caac9bb.tar.gz
scummvm-rg350-9a8070da3c533dd4885e8044051a5e1a9caac9bb.tar.bz2
scummvm-rg350-9a8070da3c533dd4885e8044051a5e1a9caac9bb.zip
SCI: Do some clean-up of event handling system
Convert macros and vars to enums, rename keyboard events in preparation for adding key up events, clean up unnecessary nested conditionals, add TODOs for potential future work.
Diffstat (limited to 'engines/sci/graphics/controls16.cpp')
-rw-r--r--engines/sci/graphics/controls16.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/sci/graphics/controls16.cpp b/engines/sci/graphics/controls16.cpp
index 479044a3e2..138f49e765 100644
--- a/engines/sci/graphics/controls16.cpp
+++ b/engines/sci/graphics/controls16.cpp
@@ -158,50 +158,50 @@ void GfxControls16::kernelTexteditChange(reg_t controlObject, reg_t eventObject)
eventType = readSelectorValue(_segMan, eventObject, SELECTOR(type));
switch (eventType) {
- case SCI_EVENT_MOUSE_PRESS:
+ case kSciEventMousePress:
// TODO: Implement mouse support for cursor change
break;
- case SCI_EVENT_KEYBOARD:
+ case kSciEventKeyDown:
eventKey = readSelectorValue(_segMan, eventObject, SELECTOR(message));
modifiers = readSelectorValue(_segMan, eventObject, SELECTOR(modifiers));
switch (eventKey) {
- case SCI_KEY_BACKSPACE:
+ case kSciKeyBackspace:
if (cursorPos > 0) {
cursorPos--; text.deleteChar(cursorPos);
textChanged = true;
}
break;
- case SCI_KEY_DELETE:
+ case kSciKeyDelete:
if (cursorPos < textSize) {
text.deleteChar(cursorPos);
textChanged = true;
}
break;
- case SCI_KEY_HOME: // HOME
+ case kSciKeyHome:
cursorPos = 0; textChanged = true;
break;
- case SCI_KEY_END: // END
+ case kSciKeyEnd:
cursorPos = textSize; textChanged = true;
break;
- case SCI_KEY_LEFT: // LEFT
+ case kSciKeyLeft:
if (cursorPos > 0) {
cursorPos--; textChanged = true;
}
break;
- case SCI_KEY_RIGHT: // RIGHT
+ case kSciKeyRight:
if (cursorPos + 1 <= textSize) {
cursorPos++; textChanged = true;
}
break;
- case 3: // returned in SCI1 late and newer when Control - C is pressed
- if (modifiers & SCI_KEYMOD_CTRL) {
+ case kSciKeyEtx:
+ if (modifiers & kSciKeyModCtrl) {
// Control-C erases the whole line
cursorPos = 0; text.clear();
textChanged = true;
}
break;
default:
- if ((modifiers & SCI_KEYMOD_CTRL) && eventKey == 99) {
+ if ((modifiers & kSciKeyModCtrl) && eventKey == 99) {
// Control-C in earlier SCI games (SCI0 - SCI1 middle)
// Control-C erases the whole line
cursorPos = 0; text.clear();