查询多点触控支持的具体指针数量
有没有办法以编程方式获得触摸屏可以同时检测到的最大单个手指数量?
我只能找到 FEATURE_TOUCHSCREEN_MULTITOUCH
、FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT
和 FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
,它们仅告诉我硬件是否支持“2 个或更多”和“ 5个或更多”,分别。 据我所知,没有办法获得支持的确切数量的手指。
我已经能够通过以下代码发现我的 Nexus S 支持最多 5 个手指:
public boolean onTouchEvent(MotionEvent event) {
Log.d("multitouch", event.getPointerCount() + " fingers detected");
return super.onTouchEvent(event);
}
但我希望能够从某种环境变量中获取此数据,这样我的用户就不必去通过“检测屏幕”只是为了获取这些信息。
Is there any way to get programatically the maximum number of individual fingers that the touch screen can detect simultaneously?
I've only been able to find FEATURE_TOUCHSCREEN_MULTITOUCH
, FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT
and FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
, which only tell me if the hardware supports "2 or more" and "5 or more", respectively.
As far as I've seen, there's no way to get the exact number of fingers supported.
I've been able to find out that my Nexus S supports a maximum of 5 fingers with the following code:
public boolean onTouchEvent(MotionEvent event) {
Log.d("multitouch", event.getPointerCount() + " fingers detected");
return super.onTouchEvent(event);
}
But I'd like to be able to get this data from some sort of environment variable so my users won't have to go through a "detection screen" just to get this information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过分析 event.toString() 来做到这一点
You can do so by analizing the event.toString()