入门支持的触摸点的数目 [英] Getting the number of touch points supported
问题描述
我知道,支持触摸点的数量从设备到设备的不同,但有没有办法通过API或通过code拿到这个数字的设备?
I know that the number of touch points supported is different from device to device, but is there a way through the API or through code to get that number for the device?
推荐答案
您可以多点触控的各个大类区分(无,捏手势而已,真正的2点多点触摸,真正的5点多点触控),通过搜索结果<一href="http://developer.android.com/reference/android/content/pm/PackageManager.html#getSystemAvailableFeatures%28%29"相对=nofollow> PackageManager#getSystemAvailableFeatures()列出的各种android.hardware.touchscreen。*功能的此处。
You can distinguish between various broad classes of multitouch (none, pinch gestures only, true 2-point multitouch, true 5-point multitouch) by searching the result of PackageManager#getSystemAvailableFeatures() for the various "android.hardware.touchscreen.*" features listed here.
如果你想知道究竟有多少接触可能是present,你就得看MotionEvents,因为他们进来了。
If you want to know exactly how many touches may be present, you'll just have to watch MotionEvents as they come in.
这篇关于入门支持的触摸点的数目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!