Example #1
0
        public void ClickHold(int x, int y, int delay = 0, string button = "left")
        {
            uint num = this.MakeButtonMessage(button);

            AutoSpy.PostMessage(this.ControlHandle, num, 0u, this.MakeLong(x, y));
            Thread.Sleep(delay);
            AutoSpy.PostMessage(this.ControlHandle, num + 1u, 0u, this.MakeLong(x, y));
        }
Example #2
0
 public void PressKey(uint key, int times = 1, int delay = 0)
 {
     for (int i = 0; i < times; i++)
     {
         AutoSpy.PostMessage(this.ControlHandle, 256u, key, 0u);
         AutoSpy.PostMessage(this.ControlHandle, 257u, key, 0u);
         Thread.Sleep(delay);
     }
 }
Example #3
0
        public void ClickDrag(int startX, int startY, int endX, int endY, int delay = 0, string button = "left")
        {
            uint num    = this.MakeButtonMessage(button);
            uint wParam = this.MakeButtonPressedMessage(button);

            AutoSpy.PostMessage(this.ControlHandle, num, 0u, this.MakeLong(startX, startY));
            Thread.Sleep(delay / 2);
            AutoSpy.PostMessage(this.ControlHandle, 512u, wParam, this.MakeLong(endX, endY));
            Thread.Sleep(delay / 2);
            AutoSpy.PostMessage(this.ControlHandle, num + 1u, 0u, this.MakeLong(endX, endY));
        }
Example #4
0
        public void Click(int x, int y, int numClicks = 1, int delay = 0, string button = "left")
        {
            uint num    = this.MakeButtonMessage(button);
            uint lParam = this.MakeLong(x, y);

            for (int i = 0; i < numClicks; i++)
            {
                AutoSpy.PostMessage(this.ControlHandle, num, 0u, lParam);
                AutoSpy.PostMessage(this.ControlHandle, num + 1u, 0u, lParam);
                Thread.Sleep(delay);
            }
        }
Example #5
0
 public void Scroll(int x, int y, int scrolls = -1, int wheelDelta = 120)
 {
     AutoSpy.PostMessage(this.ControlHandle, 522u, (uint)((uint)(wheelDelta * scrolls) << 16), this.MakeLong(x, y));
 }
Example #6
0
 public void HoldKey(uint key, int times = 1, int delay = 0)
 {
     AutoSpy.PostMessage(this.ControlHandle, 256u, key, 0u);
     Thread.Sleep(delay);
     AutoSpy.PostMessage(this.ControlHandle, 257u, key, 0u);
 }