diff options
Diffstat (limited to 'src/android/jar/src/org/qtproject/qt5/android/QtNative.java')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 48510b3fdf..04b8e6a06f 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -93,6 +93,7 @@ public class QtNative private static final int m_moveThreshold = 0; private static ClipboardManager m_clipboardManager = null; private static Method m_checkSelfPermissionMethod = null; + private static Boolean m_tabletEventSupported = null; private static final Runnable runPendingCppRunnablesRunnable = new Runnable() { @Override public void run() { @@ -385,6 +386,9 @@ public class QtNative { int pointerType = 0; + if (m_tabletEventSupported == null) + m_tabletEventSupported = isTabletEventSupported(); + switch (event.getToolType(0)) { case MotionEvent.TOOL_TYPE_STYLUS: pointerType = 1; // QTabletEvent::Pen @@ -395,7 +399,7 @@ public class QtNative // TODO TOOL_TYPE_MOUSE } - if (pointerType != 0) { + if (m_tabletEventSupported && pointerType != 0) { tabletEvent(id, event.getDeviceId(), event.getEventTime(), event.getAction(), pointerType, event.getButtonState(), event.getX(), event.getY(), event.getPressure()); } else { @@ -762,6 +766,7 @@ public class QtNative // pointer methods // tablet methods + public static native boolean isTabletEventSupported(); public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure); // tablet methods |