Exemplo n.º 1
0
        void  Drag(object sender, DragEventArgs e)
        {
            Vector2 pos = e.LocalPosition;

            // 1 finger
            if (Frame.TC == 1)
            {
                if (Frame.RelativeDragOne)
                {
                    pos = e.Distance;
                }
                if (e.Distance.X != 0 || e.Distance.Y != 0)
                {
                    SendPacket.sendDrag1((int)pos.X, (int)pos.Y);
                    Console.WriteLine("Drag1 at " + pos.ToString());
                    //SendPacket.sendLeftMouseDown((int)e.LocalPosition.X,(int)e.LocalPosition.Y);//jonathan using drag as a mousedown
                    //Console.WriteLine(" sendLeftMouseDown at" + e.LocalPosition.ToString());
                }
            }

            // 2 fingers
            if (Frame.TC == 2)
            {
                if (e.Distance.X != 0 || e.Distance.Y != 0)
                {
                    if (Frame.RelativeDragTwo)
                    {
                        pos = e.Distance;
                    }
                    SendPacket.sendDrag2((int)pos.X, (int)pos.Y);
                    Console.WriteLine("Drag2 at " + pos.ToString());
                }
            }
        }
Exemplo n.º 2
0
        void  Drag(object sender, DragEventArgs e)
        {
            Vector2 pos = e.LocalPosition;

            // 1 finger
            if (Frame.TC == 1)
            {
                if (Frame.RelativeDragOne)
                {
                    pos = e.Distance;
                }
                if (e.Distance.X != 0 || e.Distance.Y != 0)
                {
                    SendPacket.sendDrag1((int)pos.X, (int)pos.Y);
                    Console.WriteLine("Drag1 at " + pos.ToString());
                }
            }

            // 2 fingers
            if (Frame.TC == 2)
            {
                if (e.Distance.X != 0 || e.Distance.Y != 0)
                {
                    if (Frame.RelativeDragTwo)
                    {
                        pos = e.Distance;
                    }
                    SendPacket.sendDrag2((int)pos.X, (int)pos.Y);
                    Console.WriteLine("Drag2 at " + pos.ToString());
                }
            }
        }