From 26dd2f5f603b10b3b54664b6589c8feb6c4f7b82 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sat, 3 Sep 2011 17:21:25 +0200 Subject: GOB: Move keyPressed() to Util --- engines/gob/util.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/gob/util.cpp') diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 58dfc9c7ad..7f9c6131fd 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -257,6 +257,18 @@ bool Util::checkKey(int16 &key) { return true; } +bool Util::keyPressed() { + int16 key = checkKey(); + if (key) + return true; + + int16 x, y; + MouseButtons buttons; + + getMouseState(&x, &y, &buttons); + return buttons != kMouseButtonsNone; +} + void Util::getMouseState(int16 *pX, int16 *pY, MouseButtons *pButtons) { Common::Point mouse = g_system->getEventManager()->getMousePos(); *pX = mouse.x + _vm->_video->_scrollOffsetX - _vm->_video->_screenDeltaX; -- cgit v1.2.3