示例#1
0
        public MacroMouse Wheel(WheelDirection Direction, double Count)
        {
            if (Count <= 0)
            {
                throw new ArgumentOutOfRangeException("Count");
            }

            MouseEvent E;

            if (Direction == WheelDirection.Up || Direction == WheelDirection.Down)
            {
                E = MouseEvent.MOUSEEVENTF_WHEEL;
            }
            else
            {
                E = MouseEvent.MOUSEEVENTF_HWHEEL;
            }

            int dwData = (int)(120.0 * Count);

            if (Direction == WheelDirection.Left || Direction == WheelDirection.Down)
            {
                dwData = -dwData;
            }

            StaticFunction.mouse_event((int)E, 0, 0, dwData, IntPtr.Zero);

            return(this);
        }
示例#2
0
        public MacroMouse Up(MMouseButton Button)
        {
            if (KeyHolder.IsRegist(Button))
            {
                KeyHolder.Unregist(Button);
            }

            switch (Button)
            {
            case MMouseButton.Left:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_LEFTUP, 0, 0, 0, IntPtr.Zero);
                break;

            case MMouseButton.Right:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_RIGHTUP, 0, 0, 0, IntPtr.Zero);
                break;

            case MMouseButton.Middle:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_MIDDLEUP, 0, 0, 0, IntPtr.Zero);
                break;

            case MMouseButton.X1:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_XUP, 0, 0, 1, IntPtr.Zero);
                break;

            case MMouseButton.X2:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_XUP, 0, 0, 2, IntPtr.Zero);
                break;

            default:
                throw new ArgumentOutOfRangeException("Button");
            }

            return(this);
        }
示例#3
0
        public MacroMouse Down(MMouseButton Button)
        {
            switch (Button)
            {
            case MMouseButton.Left:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, IntPtr.Zero);
                break;

            case MMouseButton.Right:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, IntPtr.Zero);
                break;

            case MMouseButton.Middle:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, IntPtr.Zero);
                break;

            case MMouseButton.X1:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_XDOWN, 0, 0, 1, IntPtr.Zero);
                break;

            case MMouseButton.X2:
                StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_XDOWN, 0, 0, 2, IntPtr.Zero);
                break;

            default:
                throw new ArgumentOutOfRangeException("Button");
            }

            return(this);
        }
示例#4
0
        public MacroMouse Move(int X, int Y)
        {
            StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_MOVE, X, Y, 0, IntPtr.Zero);

            return(this);
        }
示例#5
0
        public MacroMouse Move(MPoint Point)
        {
            StaticFunction.mouse_event((int)MouseEvent.MOUSEEVENTF_MOVE, Point.X, Point.Y, 0, IntPtr.Zero);

            return(this);
        }