path: root/src/plugins/platforms/android/src/androidjniinput.cpp
diff options
authorPaul Olav Tvete <>2013-06-10 11:56:14 +0200
committerThe Qt Project <>2013-06-10 23:30:02 +0200
commit425af59f534ed8a0f4bc7a77a1f83e4d1e2e2bdc (patch)
tree455d365d031e99a166ed58f6cd8fb0f8c1dfb11a /src/plugins/platforms/android/src/androidjniinput.cpp
parent900cccfd459fcbdbc4aa3d313afe12cfbf68fd87 (diff)
Disable long press on Android
Remove the mapping from press-and-hold to right-mouse-button press. This logic was implemented in the android plugin, and there was no way to disable it for applications that needed to handle long presses in a different way. Add an environment variable to enable the mapping for those who really need it, but do not advertise it. (We want to add a proper API for this in 5.2) Task-number: QTBUG-31644 Change-Id: Ia5ae75d6147485b73c78b7c3fa88d11af5d84c06 Reviewed-by: BogDan Vatra <>
Diffstat (limited to 'src/plugins/platforms/android/src/androidjniinput.cpp')
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp
index da6156a330..29ccfe0125 100644
--- a/src/plugins/platforms/android/src/androidjniinput.cpp
+++ b/src/plugins/platforms/android/src/androidjniinput.cpp
@@ -163,6 +163,10 @@ namespace QtAndroidInput
static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y)
+ //### TODO: add proper API for Qt 5.2
+ static bool rightMouseFromLongPress = qgetenv("QT_NECESSITAS_COMPATIBILITY_LONG_PRESS").toInt();
+ if (!rightMouseFromLongPress)
+ return;
m_ignoreMouseEvents = true;
QPoint globalPos(x,y);
QWindow *tlw = topLevelWindowAt(globalPos);