示例#1
0
 public static void WheelUp(int times = 1)
 {
     while (times-- > 0)
     {
         MouseSimulator.mouse_event(MouseSimulator.MouseEventFlag.MOUSEEVENTF_WHEEL, 0, 0, 100, 0);
     }
 }
示例#2
0
 public static void MouseUp(MouseButtons button)
 {
     if (button != MouseButtons.Left)
     {
         if (button != MouseButtons.Right)
         {
             if (button != MouseButtons.Middle)
             {
                 return;
             }
             MouseSimulator.mouse_event(MouseSimulator.MouseEventFlag.MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0);
         }
         else
         {
             MouseSimulator.mouse_event(MouseSimulator.MouseEventFlag.MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
         }
     }
     else
     {
         MouseSimulator.mouse_event(MouseSimulator.MouseEventFlag.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
     }
 }
示例#3
0
        public void Play()
        {
            this.Stop();
            foreach (MacroEvent macroEvent in this.events)
            {
                Common.Sleep(macroEvent.TimeSinceLastEvent);
                switch (macroEvent.MacroEventType)
                {
                case MacroEventType.MouseMove:
                    MouseEventArgs mouseEventArgs = (MouseEventArgs)macroEvent.EventArgs;
                    MouseSimulator.X = mouseEventArgs.X;
                    MouseSimulator.Y = mouseEventArgs.Y;
                    continue;

                case MacroEventType.MouseDown:
                    MouseSimulator.MouseDown(((MouseEventArgs)macroEvent.EventArgs).Button);
                    continue;

                case MacroEventType.MouseUp:
                    MouseSimulator.MouseUp(((MouseEventArgs)macroEvent.EventArgs).Button);
                    continue;

                case MacroEventType.KeyDown:
                    KeyboardSimulator.KeyDown(((KeyEventArgs)macroEvent.EventArgs).KeyCode);
                    KeyboardSimulator.KeyUp(Keys.A);
                    KeyboardSimulator.KeyPress(Keys.A);
                    KeyboardSimulator.SimulateStandardShortcut(StandardShortcut.Copy);
                    continue;

                case MacroEventType.KeyUp:
                    KeyboardSimulator.KeyUp(((KeyEventArgs)macroEvent.EventArgs).KeyCode);
                    continue;

                default:
                    continue;
                }
            }
        }
示例#4
0
 public static void Hide()
 {
     MouseSimulator.ShowCursor(false);
 }
示例#5
0
 public static void Show()
 {
     MouseSimulator.ShowCursor(true);
 }
示例#6
0
 public static void DoubleClick(MouseButtons button)
 {
     MouseSimulator.Click(button);
     MouseSimulator.Click(button);
 }
示例#7
0
 public static void Click(MouseButtons button)
 {
     MouseSimulator.MouseDown(button);
     MouseSimulator.MouseUp(button);
 }