Question

I've heard of:

MotionEvent e;
float press = e.getPressure(...);

But this only returns 0 for no touch, and 1 when my finger touches the screen.

Is it possible to find a value for the amount of pressure your finger is putting on the screen with touch capacitive screens?

Or is my hunch correct that this will only work with resistive screens..?

Was it helpful?

Solution

MotionEvent().getPressure(i) should return a value between 0 and 1 based on the "pressure" placed on the screen. In reality for capacitive screens it is the size of the capacitive object rather than literal pressure, but the concept is almost the same for fingers (fingers are squishy). Ranges higher than one may be returned depending on the calibration of the touchscreen.

If your screen is only returning 0 or 1, try testing on another device. Perhaps your screens driver simply does not return those values.

MotionEvent | Android Developers : getPressure()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top