[Xposed Framework Modules] tkgktyk:
**** THIS PROJECT IS NO LONGER MAINTAINED ****

Force Touch Detector

Force Touch Detector (FTD) is a Xposed module to detect Force Touch and switch touch action. FTD assigns seven force actions:

Tap

Double Tap

Long Press

Flick Left

Flick Right

Flick Up

Flick Down

Of course FTD doesn't bother normal operation by the threshold of pressure.

Introduction

Android reports pressure of your touch when you tap, press, swipe, and so on. However the pressure is different from Apple's Force Touch Technology. (It is mechanical implementation, isn't it?) Android's pressure is depending on touch area of your finger, not strength. But the touch area provides us new UI.

Force Touch on Android

[IMG="touch1"]https://raw.githubusercontent.com/tkgktyk/ForceTouch/master/art/touch2.png[/IMG][IMG="touch1"]https://raw.githubusercontent.com/tkgktyk/ForceTouch/master/art/touch3.png[/IMG]

[YOUTUBE]Ori1llb2p40[/YOUTUBE]

If you touch with the ball of your finger, the touch area increases. Call this "Force Touch" in this project. It is possible to distinguish ordinary touch operation from deliberately Force Touch because there is a distinct difference between these touch area. By checking whether a touch event is started from Force Touch, you can change the action of the touch.

Example:

Open floating launcher when you do force tap that is a tap started from Force Touch.

Go back by performing force flick to right that is a flick started from Force Touch.

Expand notifications by performing force flick to bottom anywhere.

Getting Started

At first, check your hardware supports FTD functions or not. Open a threshold screen, Pressure -> Threshold, and then test tap and force touch with two buttons. If Max, Pressure and Ave are changed by each touch, your touch screen supports the pressure parameter, you can use FTD by pressure. If not so, your phone doesn't support pressure, next try Size -> Threshold screen.

Note that some smartphones don't support both the pressure and the size parameter. FTD doesn't work on such a device.

After checking the capability of your touch screen, practice and adjust Force Touch with Threshold screen. Tap small button and do force touch on large button 5 times or more respectively, you'll get a Max value for normal tap and an Ave value for force touch. The Ave value must be higher than the Max value, you should practice force touch until so.

Finally, input a number between the Ave and the Max, and turn Master Switch on.

Adjustment

There are 3 parameters to adjust sensitivity for force touch.

Threshold

When pressure or size of your touch exceed this value, it is recognized as a force touch.​

Detection Window

The length of time FTD waits for force touch. If zero, FTD checks only the beginning of your touch stroke.​

Detection Sensitivity

The sensitivity for force tap and flick. If zero, Force Touch is always interpreted as a flick. If too high value, it is always tap. The range is 0 to about 20, depends on hardware.​

I propose two strategies for adjustment.

Long detection window and high threshold value

Short detection window and mid threshold value

Maybe the experience of the former is near to Apple's Force Touch, squashing. However Android devices detect the pressure of touch by touch area even if you enable Pressure Threshold. In the other words, FTD's Force Touch based on Android API and Apple's one are fundamentally different. So I recommend to try both strategies.

Pressure vs. Size

These touch parameter depend on your hardware. Some phones report both parameters, some phones report only one parameter, and there may be some phones that don't report neither.

Reported Devices (shared/editable spreadsheet)

Compatibility

I tested on Nexus 4 running AOSP 5.1.1.

Q&A

Q. Does this mod work on my phone?

Activate the pointer location in dev options to see your touch pressure and size. If they are always same value, your hardware doesn't support them.

Download

Xposed Module Repository

XDA:DevDB Information

Force Touch Detector, Xposed for all devices (see above for details)

Contributors

tkgktyk

Source Code: https://github.com/tkgktyk/ForceTouch

Xposed Package Name: jp.tkgktyk.xposed.forcetouchdetector

Version Information

Status: Stable

Stable Release Date: 2015-07-28

Created 2015-06-08

Last Updated 2016-10-25