diff options
author | Sven Hesse | 2011-09-03 17:21:25 +0200 |
---|---|---|
committer | Sven Hesse | 2011-09-03 18:00:09 +0200 |
commit | 26dd2f5f603b10b3b54664b6589c8feb6c4f7b82 (patch) | |
tree | a0333c3dd368f8f107fcbcb6ff6f3ae5f220d44b /engines/gob/util.cpp | |
parent | dbb70e3d6f3b6ce5ff0497dbded420783edb3256 (diff) | |
download | scummvm-rg350-26dd2f5f603b10b3b54664b6589c8feb6c4f7b82.tar.gz scummvm-rg350-26dd2f5f603b10b3b54664b6589c8feb6c4f7b82.tar.bz2 scummvm-rg350-26dd2f5f603b10b3b54664b6589c8feb6c4f7b82.zip |
GOB: Move keyPressed() to Util
Diffstat (limited to 'engines/gob/util.cpp')
-rw-r--r-- | engines/gob/util.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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; |