diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-09 13:23:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-09 14:44:09 +0300 |
commit | c66e0863ecc24145c57261987eb8e25776c303ce (patch) | |
tree | 17bb98deebd60463cb01bad865a92b766272efed /src/gui/gui.cpp | |
parent | 4c90395b1b42d436545b33a855ef431f5ede6a9b (diff) | |
download | manaverse-c66e0863ecc24145c57261987eb8e25776c303ce.tar.gz manaverse-c66e0863ecc24145c57261987eb8e25776c303ce.tar.bz2 manaverse-c66e0863ecc24145c57261987eb8e25776c303ce.tar.xz manaverse-c66e0863ecc24145c57261987eb8e25776c303ce.zip |
Add support for long mouse press event.
Enabled by default on Android.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 55da1b9e3..554c1ff42 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1436,3 +1436,13 @@ void Gui::handleModalFocusReleased() parent = swap->getParent(); } } + +int Gui::getMousePressLength() +{ + if (!mLastMousePressTimeStamp) + return 0; + int ticks = SDL_GetTicks(); + if (ticks > mLastMousePressTimeStamp) + return ticks - mLastMousePressTimeStamp; + return mLastMousePressTimeStamp - ticks; +} |