diff options
author | Colin Snover | 2017-09-25 20:51:10 -0500 |
---|---|---|
committer | Colin Snover | 2017-09-27 20:27:33 -0500 |
commit | 9a8070da3c533dd4885e8044051a5e1a9caac9bb (patch) | |
tree | f2ade382b357b7f9e66b7cae288023820ca670b6 /engines/sci/graphics | |
parent | c88d5519c2e2672ce7faabfa52f36af4a8706cba (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/sci/graphics/controls16.cpp | 22 | ||||
-rw-r--r-- | engines/sci/graphics/controls32.cpp | 42 | ||||
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/maciconbar.cpp | 10 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 78 | ||||
-rw-r--r-- | engines/sci/graphics/portrait.cpp | 18 | ||||
-rw-r--r-- | engines/sci/graphics/video32.cpp | 20 |
8 files changed, 100 insertions, 94 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(); diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index 77dfdc20bb..52a9dfa9b3 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -154,22 +154,22 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) { // the last event just gets posted back to the event manager for // reprocessing, but instead, we only remove the event from the // queue *after* we have determined it is not a defocusing event - const SciEvent event = eventManager->getSciEvent(SCI_EVENT_ANY | SCI_EVENT_PEEK); + const SciEvent event = eventManager->getSciEvent(kSciEventAny | kSciEventPeek); bool focused = true; // Original engine did not have a QUIT event but we have to handle it - if (event.type == SCI_EVENT_QUIT) { + if (event.type == kSciEventQuit) { focused = false; - } else if (event.type == SCI_EVENT_MOUSE_PRESS && !editorPlaneRect.contains(event.mousePosSci)) { + } else if (event.type == kSciEventMousePress && !editorPlaneRect.contains(event.mousePosSci)) { focused = false; - } else if (event.type == SCI_EVENT_KEYBOARD) { + } else if (event.type == kSciEventKeyDown) { switch (event.character) { - case SCI_KEY_ESC: - case SCI_KEY_UP: - case SCI_KEY_DOWN: - case SCI_KEY_TAB: - case SCI_KEY_SHIFT_TAB: - case SCI_KEY_ENTER: + case kSciKeyEsc: + case kSciKeyUp: + case kSciKeyDown: + case kSciKeyTab: + case kSciKeyShiftTab: + case kSciKeyEnter: focused = false; break; } @@ -181,8 +181,8 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) { // Consume the event now that we know it is not one of the // defocusing events above - if (event.type != SCI_EVENT_NONE) - eventManager->getSciEvent(SCI_EVENT_ANY); + if (event.type != kSciEventNone) + eventManager->getSciEvent(kSciEventAny); // NOTE: In the original engine, the font and bitmap were // reset here on each iteration through the loop, but it @@ -195,33 +195,33 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) { bool shouldDeleteChar = false; bool shouldRedrawText = false; uint16 lastCursorPosition = editor.cursorCharPosition; - if (event.type == SCI_EVENT_KEYBOARD) { + if (event.type == kSciEventKeyDown) { switch (event.character) { - case SCI_KEY_LEFT: + case kSciKeyLeft: clearTextOnInput = false; if (editor.cursorCharPosition > 0) { --editor.cursorCharPosition; } break; - case SCI_KEY_RIGHT: + case kSciKeyRight: clearTextOnInput = false; if (editor.cursorCharPosition < editor.text.size()) { ++editor.cursorCharPosition; } break; - case SCI_KEY_HOME: + case kSciKeyHome: clearTextOnInput = false; editor.cursorCharPosition = 0; break; - case SCI_KEY_END: + case kSciKeyEnd: clearTextOnInput = false; editor.cursorCharPosition = editor.text.size(); break; - case SCI_KEY_INSERT: + case kSciKeyInsert: clearTextOnInput = false; // Redrawing also changes the cursor rect to // reflect the new insertion mode @@ -229,14 +229,14 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) { _overwriteMode = !_overwriteMode; break; - case SCI_KEY_DELETE: + case kSciKeyDelete: clearTextOnInput = false; if (editor.cursorCharPosition < editor.text.size()) { shouldDeleteChar = true; } break; - case SCI_KEY_BACKSPACE: + case kSciKeyBackspace: clearTextOnInput = false; shouldDeleteChar = true; if (editor.cursorCharPosition > 0) { @@ -244,7 +244,7 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) { } break; - case SCI_KEY_ETX: + case kSciKeyEtx: editor.text.clear(); editor.cursorCharPosition = 0; shouldRedrawText = true; diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index 89bb2a2307..6b18dce518 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -479,7 +479,7 @@ void GfxCursor::kernelMoveCursor(Common::Point pos) { // Trigger event reading to make sure the mouse coordinates will // actually have changed the next time we read them. - _event->getSciEvent(SCI_EVENT_PEEK); + _event->getSciEvent(kSciEventPeek); } void GfxCursor::kernelSetMacCursor(GuiResourceId viewNum, int loopNum, int celNum) { diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index cd48c78fdd..a7b529fe90 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -394,7 +394,7 @@ private: // position is rendered instead of whatever position it was at the last // time kGetEvent was called. Without this, the mouse appears stuck // during loops that do not make calls to kGetEvent, like transitions. - g_sci->getEventManager()->getSciEvent(SCI_EVENT_PEEK); + g_sci->getEventManager()->getSciEvent(kSciEventPeek); } /** diff --git a/engines/sci/graphics/maciconbar.cpp b/engines/sci/graphics/maciconbar.cpp index 3a62760398..c5c2fb97af 100644 --- a/engines/sci/graphics/maciconbar.cpp +++ b/engines/sci/graphics/maciconbar.cpp @@ -245,10 +245,10 @@ bool GfxMacIconBar::pointOnIcon(uint32 iconIndex, Common::Point point) { reg_t GfxMacIconBar::handleEvents() { // Peek event queue for a mouse button press EventManager *evtMgr = g_sci->getEventManager(); - SciEvent evt = evtMgr->getSciEvent(SCI_EVENT_MOUSE_PRESS | SCI_EVENT_PEEK); + SciEvent evt = evtMgr->getSciEvent(kSciEventMousePress | kSciEventPeek); // No mouse press found - if (evt.type == SCI_EVENT_NONE) + if (evt.type == kSciEventNone) return NULL_REG; // If the mouse is not over the icon bar, return @@ -256,7 +256,7 @@ reg_t GfxMacIconBar::handleEvents() { return NULL_REG; // Remove event from queue - evtMgr->getSciEvent(SCI_EVENT_MOUSE_PRESS); + evtMgr->getSciEvent(kSciEventMousePress); // Mouse press on the icon bar, check the icon rectangles uint iconNr; @@ -273,14 +273,14 @@ reg_t GfxMacIconBar::handleEvents() { bool isSelected = true; // Wait for mouse release - while (evt.type != SCI_EVENT_MOUSE_RELEASE) { + while (evt.type != kSciEventMouseRelease) { // Mimic behavior of SSCI when moving mouse with button held down if (isSelected != pointOnIcon(iconNr, evt.mousePos)) { isSelected = !isSelected; drawIcon(iconNr, isSelected); } - evt = evtMgr->getSciEvent(SCI_EVENT_MOUSE_RELEASE); + evt = evtMgr->getSciEvent(kSciEventMouseRelease); g_system->delayMillis(10); } diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index b7030bbea5..e677f0b487 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -142,7 +142,7 @@ void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t // Control/Alt/Function key mapping... if (controlPos) { content.setChar(SCI_MENU_REPLACE_ONCONTROL, controlPos); - itemEntry->keyModifier = SCI_KEYMOD_CTRL; + itemEntry->keyModifier = kSciKeyModCtrl; tempPos = controlPos + 1; if (tempPos >= contentSize) error("control marker at end of item"); @@ -151,7 +151,7 @@ void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t } if (altPos) { content.setChar(SCI_MENU_REPLACE_ONALT, altPos); - itemEntry->keyModifier = SCI_KEYMOD_ALT; + itemEntry->keyModifier = kSciKeyModAlt; tempPos = altPos + 1; if (tempPos >= contentSize) error("alt marker at end of item"); @@ -165,16 +165,16 @@ void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t error("function marker at end of item"); itemEntry->keyPress = content[tempPos]; switch (content[functionPos + 1]) { - case '1': itemEntry->keyPress = SCI_KEY_F1; break; - case '2': itemEntry->keyPress = SCI_KEY_F2; break; - case '3': itemEntry->keyPress = SCI_KEY_F3; break; - case '4': itemEntry->keyPress = SCI_KEY_F4; break; - case '5': itemEntry->keyPress = SCI_KEY_F5; break; - case '6': itemEntry->keyPress = SCI_KEY_F6; break; - case '7': itemEntry->keyPress = SCI_KEY_F7; break; - case '8': itemEntry->keyPress = SCI_KEY_F8; break; - case '9': itemEntry->keyPress = SCI_KEY_F9; break; - case '0': itemEntry->keyPress = SCI_KEY_F10; break; + case '1': itemEntry->keyPress = kSciKeyF1; break; + case '2': itemEntry->keyPress = kSciKeyF2; break; + case '3': itemEntry->keyPress = kSciKeyF3; break; + case '4': itemEntry->keyPress = kSciKeyF4; break; + case '5': itemEntry->keyPress = kSciKeyF5; break; + case '6': itemEntry->keyPress = kSciKeyF6; break; + case '7': itemEntry->keyPress = kSciKeyF7; break; + case '8': itemEntry->keyPress = kSciKeyF8; break; + case '9': itemEntry->keyPress = kSciKeyF9; break; + case '0': itemEntry->keyPress = kSciKeyF10; break; default: error("illegal function key specified"); } @@ -215,7 +215,7 @@ void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t tempPtr = itemEntry->text.c_str(); tempPtr = strstr(tempPtr, "Ctrl-"); if (tempPtr) { - itemEntry->keyModifier = SCI_KEYMOD_CTRL; + itemEntry->keyModifier = kSciKeyModCtrl; itemEntry->keyPress = tolower(tempPtr[5]); } } @@ -403,7 +403,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { bool forceClaimed = false; switch (eventType) { - case SCI_EVENT_KEYBOARD: + case kSciEventKeyDown: keyPress = readSelectorValue(_segMan, eventObject, SELECTOR(message)); keyModifier = readSelectorValue(_segMan, eventObject, SELECTOR(modifiers)); @@ -411,14 +411,14 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { // Ctrl+<key> is pressed, but this kMenuSelect implementation matches // on modifier + printable character, so we must convert the control // characters to their lower-case latin printed equivalents - if ((keyModifier & SCI_KEYMOD_NON_STICKY) == SCI_KEYMOD_CTRL && keyPress > 0 && keyPress < 27) { + if ((keyModifier & kSciKeyModNonSticky) == kSciKeyModCtrl && keyPress > 0 && keyPress < 27) { keyPress += 96; } switch (keyPress) { case 0: break; - case SCI_KEY_ESC: + case kSciKeyEsc: interactiveStart(pauseSound); itemEntry = interactiveWithKeyboard(); interactiveEnd(pauseSound); @@ -434,8 +434,8 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { // to Ctrl+I or the modifier check will fail and the Tab key // won't do anything. (This is also why Ctrl+I and Ctrl+Shift+I // would both bring up the inventory in SSCI QFG1EGA) - if (keyPress == SCI_KEY_TAB) { - keyModifier = SCI_KEYMOD_CTRL; + if (keyPress == kSciKeyTab) { + keyModifier = kSciKeyModCtrl; keyPress = 'i'; } @@ -455,7 +455,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { } break; - case SCI_EVENT_SAID: + case kSciEventSaid: while (itemIterator != itemEnd) { itemEntry = *itemIterator; @@ -476,7 +476,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { itemEntry = NULL; break; - case SCI_EVENT_MOUSE_PRESS: { + case kSciEventMousePress: { Common::Point mousePosition; mousePosition.x = readSelectorValue(_segMan, eventObject, SELECTOR(x)); mousePosition.y = readSelectorValue(_segMan, eventObject, SELECTOR(y)); @@ -755,34 +755,34 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() { _paint16->bitsShow(_menuRect); while (true) { - curEvent = _event->getSciEvent(SCI_EVENT_ANY); + curEvent = _event->getSciEvent(kSciEventAny); switch (curEvent.type) { - case SCI_EVENT_KEYBOARD: + case kSciEventKeyDown: // We don't 100% follow sierra here: // - sierra didn't wrap around when changing item id // - sierra allowed item id to be 0, which didn't make any sense do { switch (curEvent.character) { - case SCI_KEY_ESC: + case kSciKeyEsc: _curMenuId = curItemEntry->menuId; _curItemId = curItemEntry->id; return NULL; - case SCI_KEY_ENTER: + case kSciKeyEnter: if (curItemEntry->enabled) { _curMenuId = curItemEntry->menuId; _curItemId = curItemEntry->id; return curItemEntry; } break; - case SCI_KEY_LEFT: + case kSciKeyLeft: newMenuId--; newItemId = 1; break; - case SCI_KEY_RIGHT: + case kSciKeyRight: newMenuId++; newItemId = 1; break; - case SCI_KEY_UP: + case kSciKeyUp: newItemId--; break; - case SCI_KEY_DOWN: + case kSciKeyDown: newItemId++; break; } @@ -793,9 +793,9 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() { // if we do this step again because of a separator line -> don't repeat left/right, but go down switch (curEvent.character) { - case SCI_KEY_LEFT: - case SCI_KEY_RIGHT: - curEvent.character = SCI_KEY_DOWN; + case kSciKeyLeft: + case kSciKeyRight: + curEvent.character = kSciKeyDown; } } } while (newItemEntry->separatorLine); @@ -813,7 +813,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() { } break; - case SCI_EVENT_MOUSE_PRESS: { + case kSciEventMousePress: { Common::Point mousePosition = curEvent.mousePos; if (mousePosition.y < 10) { // Somewhere on the menubar @@ -846,9 +846,12 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() { } } break; - case SCI_EVENT_NONE: + case kSciEventNone: g_sci->sleep(2500 / 1000); break; + + default: + break; } } } @@ -875,19 +878,22 @@ GuiMenuItemEntry *GfxMenu::interactiveWithMouse() { _paint16->bitsShow(_ports->_menuRect); while (true) { - curEvent = _event->getSciEvent(SCI_EVENT_ANY); + curEvent = _event->getSciEvent(kSciEventAny); switch (curEvent.type) { - case SCI_EVENT_MOUSE_RELEASE: + case kSciEventMouseRelease: if ((curMenuId == 0) || (curItemId == 0)) return NULL; if ((!curItemEntry->enabled) || (curItemEntry->separatorLine)) return NULL; return curItemEntry; - case SCI_EVENT_NONE: + case kSciEventNone: g_sci->sleep(2500 / 1000); break; + + default: + break; } // Find out where mouse is currently pointing to diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 6b66ac50e4..8c41dabb11 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -302,9 +302,9 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint if (timerPosition > 0) { do { g_sci->getEngineState()->wait(1); - curEvent = _event->getSciEvent(SCI_EVENT_ANY); - if (curEvent.type == SCI_EVENT_MOUSE_PRESS || - (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.character == SCI_KEY_ESC) || + curEvent = _event->getSciEvent(kSciEventAny); + if (curEvent.type == kSciEventMousePress || + (curEvent.type == kSciEventKeyDown && curEvent.character == kSciKeyEsc) || g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame || g_sci->getEngineState()->_delayedRestoreGameId != -1) userAbort = true; @@ -325,9 +325,9 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint do { g_sci->getEngineState()->wait(1); - curEvent = _event->getSciEvent(SCI_EVENT_ANY); - if (curEvent.type == SCI_EVENT_MOUSE_PRESS || - (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.character == SCI_KEY_ESC) || + curEvent = _event->getSciEvent(kSciEventAny); + if (curEvent.type == kSciEventMousePress || + (curEvent.type == kSciEventKeyDown && curEvent.character == kSciKeyEsc) || g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame) userAbort = true; curPosition = _audio->getAudioPosition(); @@ -384,9 +384,9 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint // Wait till syncTime passed, then show specific animation bitmap do { g_sci->getEngineState()->wait(1); - curEvent = _event->getSciEvent(SCI_EVENT_ANY); - if (curEvent.type == SCI_EVENT_MOUSE_PRESS || - (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) || + curEvent = _event->getSciEvent(kSciEventAny); + if (curEvent.type == kSciEventMousePress || + (curEvent.type == kSciEventKeyboard && curEvent.data == kSciKeyEsc) || g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame) userAbort = true; curPosition = _audio->getAudioPosition(); diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 16884a1e9a..736ee15428 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -168,21 +168,21 @@ VideoPlayer::EventFlags VideoPlayer::checkForEvent(const EventFlags flags) { return kEventFlagEnd; } - SciEvent event = _eventMan->getSciEvent(SCI_EVENT_MOUSE_PRESS | SCI_EVENT_PEEK); - if ((flags & kEventFlagMouseDown) && event.type == SCI_EVENT_MOUSE_PRESS) { + SciEvent event = _eventMan->getSciEvent(kSciEventMousePress | kSciEventPeek); + if ((flags & kEventFlagMouseDown) && event.type == kSciEventMousePress) { return kEventFlagMouseDown; } - event = _eventMan->getSciEvent(SCI_EVENT_KEYBOARD | SCI_EVENT_PEEK); - if ((flags & kEventFlagEscapeKey) && event.type == SCI_EVENT_KEYBOARD) { + event = _eventMan->getSciEvent(kSciEventKeyDown | kSciEventPeek); + if ((flags & kEventFlagEscapeKey) && event.type == kSciEventKeyDown) { if (getSciVersion() < SCI_VERSION_3) { - while ((event = _eventMan->getSciEvent(SCI_EVENT_KEYBOARD)), - event.type != SCI_EVENT_NONE) { - if (event.character == SCI_KEY_ESC) { + while ((event = _eventMan->getSciEvent(kSciEventKeyDown)), + event.type != kSciEventNone) { + if (event.character == kSciKeyEsc) { return kEventFlagEscapeKey; } } - } else if (event.character == SCI_KEY_ESC) { + } else if (event.character == kSciKeyEsc) { return kEventFlagEscapeKey; } } @@ -734,8 +734,8 @@ VMDPlayer::EventFlags VMDPlayer::checkForEvent(const EventFlags flags) { return stopFlag; } - const SciEvent event = _eventMan->getSciEvent(SCI_EVENT_HOT_RECTANGLE | SCI_EVENT_PEEK); - if ((flags & kEventFlagHotRectangle) && event.type == SCI_EVENT_HOT_RECTANGLE) { + const SciEvent event = _eventMan->getSciEvent(kSciEventHotRectangle | kSciEventPeek); + if ((flags & kEventFlagHotRectangle) && event.type == kSciEventHotRectangle) { return kEventFlagHotRectangle; } |