summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-09 13:23:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-09 14:44:09 +0300
commitc66e0863ecc24145c57261987eb8e25776c303ce (patch)
tree17bb98deebd60463cb01bad865a92b766272efed /src/gui/gui.cpp
parent4c90395b1b42d436545b33a855ef431f5ede6a9b (diff)
downloadplus-c66e0863ecc24145c57261987eb8e25776c303ce.tar.gz
plus-c66e0863ecc24145c57261987eb8e25776c303ce.tar.bz2
plus-c66e0863ecc24145c57261987eb8e25776c303ce.tar.xz
plus-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.cpp10
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;
+}