如何在windows手机中禁用多点触控
本文关键字:多点 windows 手机 | 更新日期: 2023-09-27 18:28:08
我使用了鼠标事件,使用TouchFrameReported,我希望它是单点触摸,但它支持多点触摸,如何禁用多点触摸、在触摸框中报告,或者有没有任何想法可以实现,从而不支持多点触摸。。
void Touch_FrameReported(object sender, TouchFrameEventArgs e)
{
foreach (TouchPoint touchPoint in e.GetTouchPoints(this.mainGrid))
{
if (touchPoint.Action == TouchAction.Down)
{
currentPoint.X = touchPoint.Position.X;
currentPoint.Y = touchPoint.Position.Y;
glowDot();
}
else if (touchPoint.Action == TouchAction.Up)
{
circPathGlow.Visibility = Visibility.Collapsed;
}
else if (touchPoint.Action == TouchAction.Move)
{
}
}
}
您可以在以下位置找到更多信息:
http://social.msdn.microsoft.com/Forums/windowsapps/en-US/123e9381-fc0b-441e-a738-dcd35f526a6e/how-to-disable-multitouch
我不会试图篡改这里的触摸信息。如果目标是将拖动限制为一次一个控件,然后将其限制为控件。一旦一个人动了,就不要动其他人。
在指针消息级别,您可以跟踪PointerPressed并忽略其他PointerId,直到获得PointerReleased或PointerCaptureLost:
问题:您想禁用某些多手势还是全部禁用
阅读后http://www.wintellect.com/blogs/jprosise/building-touch-interfaces-for-windows-phones-part-2我知道我在使用e.GetTouchPoints代替e.GetPrimaryTouchPoint,,
现在,我使用e.GetPrimaryTouchPoint,它只捕获被触摸的第一个触摸点,
TouchPoint TouchPoint=e.GetPrimaryTouchPoint(this.mainGrid);剩下的代码,这解决了我的问题。