示例#1
0
 void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (TouchTest)
     {
         foreach (TouchEventHandler h in touchEventHandlers)
         {
             TouchEventArgs args = new TouchEventArgs();
             args.SetX(e.X);
             args.SetY(e.Y);
             args.SetId(0);
             h.OnTouchEnd(args);
         }
     }
     else
     {
         foreach (MouseEventHandler h in mouseEventHandlers)
         {
             MouseEventArgs args = new MouseEventArgs();
             args.SetX(e.X);
             args.SetY(e.Y);
             args.SetButton((int)e.Button);
             h.OnMouseUp(args);
         }
     }
 }
示例#2
0
 void Mouse_Move(object sender, MouseMoveEventArgs e)
 {
     lastX = e.X;
     lastY = e.Y;
     if (TouchTest)
     {
         foreach (TouchEventHandler h in touchEventHandlers)
         {
             TouchEventArgs args = new TouchEventArgs();
             args.SetX(e.X);
             args.SetY(e.Y);
             args.SetId(0);
             h.OnTouchMove(args);
         }
     }
     else
     {
         foreach (MouseEventHandler h in mouseEventHandlers)
         {
             MouseEventArgs args = new MouseEventArgs();
             args.SetX(e.X);
             args.SetY(e.Y);
             args.SetMovementX(e.XDelta);
             args.SetMovementY(e.YDelta);
             args.SetEmulated(false);
             h.OnMouseMove(args);
         }
     }
 }
示例#3
0
 void Mouse_Move(object sender, MouseMoveEventArgs e)
 {
     if (TouchTest)
     {
         foreach (TouchEventHandler h in touchEventHandlers)
         {
             TouchEventArgs args = new TouchEventArgs();
             args.SetX(e.X);
             args.SetY(e.Y);
             args.SetId(0);
             h.OnTouchMove(args);
         }
     }
     else
     {
         foreach (MouseEventHandler h in mouseEventHandlers)
         {
             MouseEventArgs args = new MouseEventArgs();
             args.SetX(e.X);
             args.SetY(e.Y);
             h.OnMouseMove(args);
         }
     }
 }