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); } } }
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); } } }
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); } } }