Android 3.0的手指触摸检测 [英] Android 3 finger touch detection

查看:126
本文介绍了Android 3.0的手指触摸检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功能记录两个手指的坐标被触摸使用以下code中的屏幕上:

I am successfully able to record the coordinates of the two fingers being touched on the screen using the following code:

case MotionEvent.ACTION_MOVE:
Log.d("TOUCH", "test ACTION MOVE" + event.getPointerCount());
Log.d("TOUCH", "test ACTION MOVE ID" + event.getPointerId(0) + " "+event.getPointerId(1));
if(event.getPointerCount()==3)
{

x0 = (int) event.getX(event.getPointerId(0));
y0 = (int) event.getY(event.getPointerId(0));
x1 = (int) event.getX(event.getPointerId(1));
y1 = (int) event.getY(event.getPointerId(1));
x2 = (int) event.getX(event.getPointerId(2));
y2 = (int) event.getY(event.getPointerId(2));

Log.d("TOUCH", "test ACTION DOWN " + " values = " + x0 + " " + y0 + " "
+ x1 + " " + y1+ " "+x2 + " " + y2);
}

但在上述code IM不能够检测到超过2的触摸点的单个实例。即使是pointerCount()永远不会高于2

But In the above code im not able to detect more then 2 touch points at a single instance. Even the pointerCount() never goes above 2.

我怎样才能获得触摸坐标为更多然后2个手指?进出口运行此code在Android 2.2

How can I get the touch coordinates for more then 2 fingers? Im running this code on Android 2.2

推荐答案

这是问前一段时间,但无论如何。答案是,虽然机器人可以跟踪256手指,目前实施限制这2个手指。

This was asked some time ago, but anyway. The answer is that although android could track 256 fingers, the current implementation limits this to 2 fingers.

我不知道蜂巢,但我想它有同样的问题。

I'm not sure about honeycomb, but I guess that it has the same "issue".

这篇关于Android 3.0的手指触摸检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆