diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-10-30 10:53:03 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-11-28 22:21:42 +0000 |
commit | 41667f7f14bb6f40d14d240c9f74d87de8435398 (patch) | |
tree | 472a0ff97be6d7a90a75260973cf913687f7068b /src/android | |
parent | 67391f0a572ddc9c53bdff35dac893b07a862fe5 (diff) |
Android: fix scrolling using a touch keyboard on Blackberry
This is a follow-up commit to 97eec16e.
Blackberry tries sending touchpad events first, and if not consumed,
it sends synthetic mouse wheel events as a fallback. This makes touch
keyboard scrolling work in native Android ListViews and other views
that do not handle SOURCE_TOUCHPAD motion events. Qt apps, however,
blindly accepted all generic motion events, so synthesized mouse wheel
events were never sent. => Make QtSurface & QtNative accept only those
motions events that are actually handled.
Task-number: QTBUG-51165
Change-Id: Iefbbf1e3e1cc3da86afc4c87c19671cc6c5fa145
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 5 | ||||
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtSurface.java | 3 |
2 files changed, 4 insertions, 4 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 902e2f68e7..ab6d556768 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -471,15 +471,16 @@ public class QtNative } } - static public void sendGenericMotionEvent(MotionEvent event, int id) + static public boolean sendGenericMotionEvent(MotionEvent event, int id) { if (event.getActionMasked() != MotionEvent.ACTION_SCROLL || (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != InputDevice.SOURCE_CLASS_POINTER) { - return; + return false; } mouseWheel(id, (int) event.getX(), (int) event.getY(), event.getAxisValue(MotionEvent.AXIS_HSCROLL), event.getAxisValue(MotionEvent.AXIS_VSCROLL)); + return true; } public static Context getContext() { diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java index e994002dd3..08b5a80f7e 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java @@ -116,7 +116,6 @@ public class QtSurface extends SurfaceView implements SurfaceHolder.Callback @Override public boolean onGenericMotionEvent(MotionEvent event) { - QtNative.sendGenericMotionEvent(event, getId()); - return true; + return QtNative.sendGenericMotionEvent(event, getId()); } } |