[Interest] State of "3D touch" (force touch) support in QT/QML

Shawn Rutledge Shawn.Rutledge at qt.io
Fri Mar 3 11:21:58 CET 2017


> On 3 Mar 2017, at 07:18, Alborz Sedaghat <alborz.se at gmail.com> wrote:
> 
> Force touch or what Apple calls 3D touch is rumored to find its way to Android soon.
> 
> Some manufacturers have already shown android phones (such as Gionee S8) that supports force touch and it is gaining more momentum after the MWC 2017.
> 
> When can we expect to get information regarding force touch support in QT?

QTouchEvent has a pressure property.  So does the TouchPoint in a MultiPointTouchArea.  So far we haven’t added support for treating specific pressure levels or changes in pressure as “gestures” but maybe we should think about that.  As usual, there could be two ways: on some platforms the OS does gesture recognition, while on others, QtQuick does its own.

I tried to add support for the Magic Trackpad here:

https://codereview.qt-project.org/#/c/139189/ 

but it has limited usefulness, because it doesn’t change the click behavior, and the pressure values begin to be available only after you have pushed hard enough to reach the first “click” level.  Maybe that’s just a default which we can change programmatically - not sure yet.  https://developer.apple.com/library/content/samplecode/ForceTouchCatalog/Introduction/Intro.html seems to show that there are more APIs which I haven’t tried yet.  And I haven’t tried on iOS, but it may be that someone else has.

As you can see in qtbase/src/plugins/platforms/android/androidjniinput.cpp we already support getting pressure from touch events on Android.  Do you think they will add any new API, or just continue providing pressure that way, and giving the app full control over the haptic feedback separately as they do now?

http://pocketnow.com/2015/09/07/force-touch-android-has-had-that-for-years says the pressure value (and the “force touch” concept) has been there since Android API 5: Eclair.  So did you see something really new at MWC?

They’ve had haptic feedback since API level 3: https://developer.android.com/reference/android/view/HapticFeedbackConstants.html 



More information about the Interest mailing list