diff options
Diffstat (limited to 'engines/pegasus/input.cpp')
-rwxr-xr-x | engines/pegasus/input.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp index 37f9945634..9ef369eb60 100755 --- a/engines/pegasus/input.cpp +++ b/engines/pegasus/input.cpp @@ -267,4 +267,31 @@ bool InputHandler::wantsCursor() { return false; } +Tracker *Tracker::_currentTracker = 0; + +void Tracker::handleInput(const Input &input, const Hotspot *) { + if (stopTrackingInput(input)) + stopTracking(input); + else if (isTracking()) + continueTracking(input); +} + +void Tracker::startTracking(const Input &) { + if (!isTracking()) { + _savedHandler = InputHandler::setInputHandler(this); + _currentTracker = this; + } +} + +void Tracker::stopTracking(const Input &) { + if (isTracking()) { + _currentTracker = NULL; + InputHandler::setInputHandler(_savedHandler); + } +} + +bool Tracker::isClickInput(const Input &input, const Hotspot *hotspot) { + return !isTracking() && InputHandler::isClickInput(input, hotspot); +} + } // End of namespace Pegasus |