我有以下问题:UITouch降落公认的移动事件
如果我点击用一个手指在触摸屏(即中指),靠近时刻手指是怎么回事了,我用第二挖掘手指(即食指)接近另一手指所在的区域,而不是发生向下的事件,我将第一根手指移动到第二根手指的下方位置。复制是有点棘手,但它是可重复的。
我有一个UIView和用于触摸我有以下:
- (void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
{
for (UITouch *touch in touches) {
int index = (int)touch;
CGPoint position = [touch locationInView:self];
NSLog(@"DOWN %d x:%f y:%f", index, position.x, position.y);
}
}
- (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event
{
for (UITouch *touch in touches) {
int index = (int)touch;
CGPoint position = [touch locationInView:self];
NSLog(@"MOVE %d x:%f y:%f", index, position.x, position.y);
}
}
- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event
{
for (UITouch *touch in touches) {
int index = (int)touch;
CGPoint position = [touch locationInView:self];
NSLog(@"UP %d %f %f", index, position.x, position.y);
}
}
当我再现它我有以下输出
DOWN 510365696 x:891.500000 y:197.000000
MOVE 510365696 x:774.000000 y:263.000000
MOVE 510365696 x:766.000000 y:268.500000
UP 510365696 764.500000 270.000000
其中上述MOVE是的下降位置第二根手指。正如你也可以看到从第一个手指应该是在位置(891,197)的UP完全丢失...
我知道我可以检测到这些“跳跃”,但没有办法区分他们从快速移动的手指。
我很感激任何帮助。
事情是我需要精度和多点触控。这两个手指就是我给我解释我的问题的一个例子。在我的情况下,我将在固定距离进行两次触摸,这可能会消失/重现,因此上述问题是不需要的行为或硬件限制。 – thodoris
@thodoris我编辑了我的答案。检查这是否工作。 – GoGreen
感谢您的建议,但我已经启用此选项。多点触控一般效果很好,但这是一种极端情况。我认为发生的事情是,我上面描述的这两个手指手势由于速度很快而被误解为快速手指移动。在手指快速移动时,手指不会跟随连续的位置,只是相邻。通过用我的手指快速做到这一点,我可以“欺骗”硬件。我将不得不为它找到解决方法,最终这是我得到的输入,我无法控制它,只是如何解释它。 – thodoris