BerggreenDK
BerggreenDK

Reputation: 5004

Touch devices (iOS, Android)

Are there any scale on the touch inputs? I know there is sensibility settings to say if you touch or not, but does it has a scale for hard pressure and low pressure too?

If so, what scale is it? 0 to 1 or 0-255 or what possiblities?

Upvotes: 3

Views: 1241

Answers (3)

picciano
picciano

Reputation: 22701

There's a workaround for iOS. See my answer in Tap pressure strength detection using accelerometer

Upvotes: 0

EboMike
EboMike

Reputation: 77752

Well, that entirely depends on the API. Android, for example, has a getPressure() accessor in MotionEvents that returns a float between 0.0f and 1.0f, but the actual granularity of your result obviously depends on the hardware - if the screen can only detect "pressed" vs "non-pressed", you will only ever get 0.0f or 1.0f.

EDIT: As per Julio Gorgé's answer, iOS does not offer this functionality.

Upvotes: 3

Julio Gorgé
Julio Gorgé

Reputation: 10106

EboMike already answered correctly your question regarding Android devices. For iOS, I can say it does not expose touch pressure information through public APIs at this moment.

Upvotes: 2

Related Questions