Puskarkc007
Puskarkc007

Reputation: 174

How to Disable Multitouch in windows phone?

I had used mouse events, using TouchFrameReported, I wanted it to be single touch, but it is supporting multitouch, how to disable multitouch, in touch frame reported, or is there any idea to implement so that multitouch is not supported..

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)
                {

                }
            }
        }

Upvotes: 2

Views: 565

Answers (2)

Puskarkc007
Puskarkc007

Reputation: 174

After reading http://www.wintellect.com/blogs/jprosise/building-touch-interfaces-for-windows-phones-part-2 I came to know that I was using e.GetTouchPoints Instead of e.GetPrimaryTouchPoint,,
Now, I use e.GetPrimaryTouchPoint, which capture only the first touch points that is being touched,,
TouchPoint touchPoint = e.GetPrimaryTouchPoint(this.mainGrid); and rest of the code,, this solve my problem.

Upvotes: 0

Odrai
Odrai

Reputation: 2353

You can find more information on:

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/123e9381-fc0b-441e-a738-dcd35f526a6e/how-to-disable-multitouch

I wouldn't try to fiddle with the touch messages here. If the goal is to limit the dragging to one control at a time then limit it to the controls. Once one is moving, don't move the others.

At the pointer message level you can track the PointerId in PointerPressed and ignore other PointerIds until you get a PointerReleased or PointerCaptureLost:

Question: Do you want to disable certain multi-gestures or all?

Upvotes: 1

Related Questions