/// <summary> /// ��������¼� /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <param name="flag"></param> private void sendMouseEvent(object sender, MouseEventArgs e,MouseEventType flag) { if (currentControler == null) lbl_Message.Text=("�㻹û�����κ������������ж�!"); else { PictureBox screenPict = (PictureBox)sender; Point epoint = ToScreenPoint(screenPict, e.Location); MouseEvent code = new MouseEvent(flag, epoint.X, epoint.Y); code.Head = CodeHead.CONTROL_MOUSE; if (epoint.X != -1) currentControler.SendCode(code); } }
/// <summary> /// �������ִ����Ӧ���� /// </summary> /// <param name="MEvent">ָ��������¼�</param> public void MouseWork(MouseEvent MEvent) { switch (MEvent.Type) { case MouseEventType.MouseMove: MouseMove(MEvent.X, MEvent.Y); break; case MouseEventType.MouseLeftDown: MouseMove(MEvent.X, MEvent.Y); MouseButton((int)MouseEventFlag.LeftDown, MEvent.X, MEvent.Y, 0, 0); break; case MouseEventType.MouseLeftUp: MouseMove(MEvent.X, MEvent.Y); MouseButton((int)MouseEventFlag.LeftUp, MEvent.X, MEvent.Y, 0, 0); break; case MouseEventType.MouseRightDown: MouseButton((int)MouseEventFlag.RightDown, MEvent.X, MEvent.Y, 0, 0); break; case MouseEventType.MouseRightUp: MouseButton((int)MouseEventFlag.RightUp, MEvent.X, MEvent.Y, 0, 0); break; case MouseEventType.MouseClick: MouseMove(MEvent.X, MEvent.Y); MouseButton((int)MouseEventFlag.LeftDown, MEvent.X, MEvent.Y, 0, 0); MouseButton((int)MouseEventFlag.LeftUp, MEvent.X, MEvent.Y, 0, 0); break; case MouseEventType.MouseDoubleClick: MouseMove(MEvent.X, MEvent.Y); MouseButton((int)MouseEventFlag.LeftDown, MEvent.X, MEvent.Y, 0, 0); MouseButton((int)MouseEventFlag.LeftDown, MEvent.X, MEvent.Y, 0, 0); MouseButton((int)MouseEventFlag.LeftUp, MEvent.X, MEvent.Y, 0, 0); MouseButton((int)MouseEventFlag.LeftUp, MEvent.X, MEvent.Y, 0, 0); break; } }