diff --git a/engines/director/events.cpp b/engines/director/events.cpp index 0e2a37f6f42..e62861fc573 100644 --- a/engines/director/events.cpp +++ b/engines/director/events.cpp @@ -129,6 +129,7 @@ void DirectorEngine::processEvents() { debugC(1, kDebugEvents, "processEvents(): keycode: %d", _keyCode); } + sc->_lastKeyTime = g_director->getMacTicks(); _lingo->processEvent(kEventKeyDown); break; diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 41d728d380d..d68d162799d 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -429,6 +429,10 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) { case kTheLastFrame: d.type = INT; d.u.i = _vm->getCurrentScore()->_frames.size() - 1; + break; + case kTheLastKey: + d.type = INT; + d.u.i = _vm->getMacTicks() - _vm->getCurrentScore()->_lastKeyTime; break; default: warning("Lingo::getTheEntity(): Unprocessed getting field \"%s\" of entity %s", field2str(field), entity2str(entity)); diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 09ff870567c..8d22a249769 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -76,6 +76,7 @@ Score::Score(DirectorEngine *vm) { _soundManager = _vm->getSoundManager(); _currentMouseDownSpriteId = 0; _mouseIsDown = false; + _lastKeyTime = _vm->getMacTicks(); // FIXME: TODO: Check whether the original truely does it if (_vm->getVersion() <= 3) { diff --git a/engines/director/score.h b/engines/director/score.h index 86b643d0e2a..76bcb028c9b 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -142,6 +142,7 @@ public: Common::Rect _movieRect; uint16 _currentMouseDownSpriteId; bool _mouseIsDown; + uint32 _lastKeyTime; bool _stopPlay; uint32 _nextFrameTime;