Exemple #1
0
 public bool RightClick()
 {
     WinIo.MyMouseKey(10, 0, 0, 0);
     Thread.Sleep(100);
     WinIo.MyMouseKey(8, 0, 0, 0);
     return(true);
 }
Exemple #2
0
 public bool MiddleClick()
 {
     WinIo.MyMouseKey(12, 0, 0, 0);
     Thread.Sleep(100);
     WinIo.MyMouseKey(8, 0, 0, 0);
     return(true);
 }
Exemple #3
0
        public bool KeyUp(VirtualKeyCode k)
        {
            if (!IsInitialize)
            {
                return(false);
            }

            WinIo.MykeyUp(k);
            return(true);
        }
Exemple #4
0
 public bool KeyPress(VirtualKeyCode k)
 {
     if (!IsInitialize)
     {
         return(false);
     }
     WinIo.MykeyDown(k);
     Thread.Sleep(100);
     WinIo.MykeyUp(k);
     return(true);
 }
Exemple #5
0
        public bool MoveTo(int x, int y)
        {
            Point point = new Point();
            bool  ret   = Win32API.GetCursorPos(out point);

            if (ret == false)
            {
                return(false);
            }
            int a = point.X - x;
            int b = point.Y - y;

            if (a > 0)
            {
                while (point.X - x != 0)
                {
                    point.X = point.X - 1;
                    WinIo.MyMouseKey(24, point.X, 0, 0);
                }
            }
            if (a < 0)
            {
                while (point.X - x != 0)
                {
                    point.X = point.X - 1;
                    WinIo.MyMouseKey(24, point.X, 0, 0); //向左移
                }
            }
            if (b > 0)
            {
                while (point.Y - y != 0)
                {
                    point.X = point.X - 1;
                    WinIo.MyMouseKey(24, point.X, 0, 0);
                }
            }
            if (b < 0)
            {
                while (y - point.Y != 0)
                {
                    point.Y += 1;
                    WinIo.MyMouseKey(40, point.Y, 0, 0);  //向下移
                }
            }
            return(true);
        }
Exemple #6
0
 public bool MiddleUp()
 {
     WinIo.MyMouseKey(8, 0, 0, 0);
     return(true);
 }
Exemple #7
0
 public bool MiddleDown()
 {
     WinIo.MyMouseKey(12, 0, 0, 0);
     return(true);
 }
Exemple #8
0
 public bool RightUp()
 {
     WinIo.MyMouseKey(8, 0, 0, 0);
     return(true);
 }
Exemple #9
0
 public bool RightDown()
 {
     WinIo.MyMouseKey(10, 0, 0, 0);
     return(true);
 }
Exemple #10
0
 public KeypadByWinIO()
 {
     IsInitialize = WinIo.Initialize();
 }