Touch设备(IOS,Android的)设备、Touch、Android、IOS

2023-09-06 17:38:12 作者:*圣女不败

有没有对触摸输入任何规模有多大?我知道有感性的设置,如果你触摸或不说,但它具有一定的规模硬pressure和低pressure呢?

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?

如果有,是什么规模呢? 0到1或0-255还是什么possiblities?

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

推荐答案

嗯,这完全取决于API。 Android的,例如,有一个获取pressure()访问的MotionEvents返回0.0和1.0F之间的浮动,但是你的结果的实际粒度显然取决于硬件 - 如果屏幕只能检测与非pressedpssed $ P $,你将永远只能拿到0.0或1.0F

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.

编辑:按胡里奥峡谷的回答,iOS的不提供此功能

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