Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to differentiate between Finger and stylus touch in android

I'm developing the drawing type of application in that particular activity i want to disable the touch events and i want to enable only the stylus event. Is there any default API in android to differentiate between two events ?

like image 705
Strawberry Avatar asked Oct 24 '25 06:10

Strawberry


1 Answers

To distinguish whether a MotionEvent is derived from a human thumb or a TPT’s pen, Volker polls MotionEvent.getTouchMajor(). If a fatty finger touches the screen, the diameter of the ellipse will be > 0. If it’s an anorexic digitizer pen, it will be 0.0f.

like image 55
whoami Avatar answered Oct 25 '25 21:10

whoami