Strawberry
Strawberry

Reputation: 651

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 ?

Upvotes: 4

Views: 1600

Answers (1)

whoami
whoami

Reputation: 1627

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.

Upvotes: 7

Related Questions