Exemplo n.º 1
0
        public static void SendMouseEvent(MouseEventStruct m)
        {
            var command = PInvoke_MouseEventFlags.LEFTDOWN;

            if (m.msg == WinFormMouseEventFlags.MOVE)
            {
                command = PInvoke_MouseEventFlags.MOVE | PInvoke_MouseEventFlags.ABSOLUTE;
            }
            else if (m.msg == WinFormMouseEventFlags.LEFTDOWN)
            {
                command = PInvoke_MouseEventFlags.LEFTDOWN;
            }
            else if (m.msg == WinFormMouseEventFlags.LEFTUP)
            {
                command = PInvoke_MouseEventFlags.LEFTUP;
            }
            else if (m.msg == WinFormMouseEventFlags.WHEEL)
            {
                command = PInvoke_MouseEventFlags.WHEEL;
            }
            else if (m.msg == WinFormMouseEventFlags.RIGHTUP)
            {
                command = PInvoke_MouseEventFlags.RIGHTUP;
            }
            else if (m.msg == WinFormMouseEventFlags.RIGHTDOWN)
            {
                command = PInvoke_MouseEventFlags.RIGHTDOWN;
            }
            else if (m.msg == WinFormMouseEventFlags.MIDDLEDOWN)
            {
                command = PInvoke_MouseEventFlags.MIDDLEDOWN;
            }
            else if (m.msg == WinFormMouseEventFlags.MIDDLEUP)
            {
                command = PInvoke_MouseEventFlags.MIDDLEUP;
            }
            else if (m.msg == WinFormMouseEventFlags.XDOWN)
            {
                command = PInvoke_MouseEventFlags.XDOWN;
            }
            else if (m.msg == WinFormMouseEventFlags.XUP)
            {
                command = PInvoke_MouseEventFlags.XUP;
            }


            mouse_event(command, (uint)m.x, (uint)m.y, (uint)m.wheel_delta, 0);

            // Console.WriteLine("Received Mouse event " + command + " " + ((uint)x) + " " + ((uint)y) + " " + ((uint)wheel_delta));
        }
Exemplo n.º 2
0
        public static void SendMouseEvent(MouseEventStruct m)
        {
            var command = PInvoke_MouseEventFlags.LEFTDOWN;
            if(m.msg == WinFormMouseEventFlags.MOVE)
                command = PInvoke_MouseEventFlags.MOVE | PInvoke_MouseEventFlags.ABSOLUTE;
            else if(m.msg == WinFormMouseEventFlags.LEFTDOWN)
                command = PInvoke_MouseEventFlags.LEFTDOWN;
            else if(m.msg == WinFormMouseEventFlags.LEFTUP)
                command = PInvoke_MouseEventFlags.LEFTUP;
            else if(m.msg == WinFormMouseEventFlags.WHEEL)
                command = PInvoke_MouseEventFlags.WHEEL;
            else if(m.msg == WinFormMouseEventFlags.RIGHTUP)
                command = PInvoke_MouseEventFlags.RIGHTUP;
            else if(m.msg == WinFormMouseEventFlags.RIGHTDOWN)
                command = PInvoke_MouseEventFlags.RIGHTDOWN;
            else if(m.msg == WinFormMouseEventFlags.MIDDLEDOWN)
                command = PInvoke_MouseEventFlags.MIDDLEDOWN;
            else if(m.msg == WinFormMouseEventFlags.MIDDLEUP)
                command = PInvoke_MouseEventFlags.MIDDLEUP;
            else if(m.msg == WinFormMouseEventFlags.XDOWN)
                command = PInvoke_MouseEventFlags.XDOWN;
            else if(m.msg == WinFormMouseEventFlags.XUP)
                command = PInvoke_MouseEventFlags.XUP;

            mouse_event(command, (uint)m.x, (uint)m.y, (uint)m.wheel_delta, 0);

            // Console.WriteLine("Received Mouse event " + command + " " + ((uint)x) + " " + ((uint)y) + " " + ((uint)wheel_delta));
        }