Exemplo n.º 1
0
        public void SendMouseMove(double percentX, double percentY, Viewer viewer)
        {
            try
            {
                InitDisplay();

                var screenBounds = viewer.Capturer.CurrentScreenBounds;
                if (EnvironmentHelper.Is64)
                {
                    LibXtst.XTestFakeMotionEvent(Display,
                                                 LibX11.XDefaultScreen(Display),
                                                 screenBounds.X + (int)(screenBounds.Width * percentX),
                                                 screenBounds.Y + (int)(screenBounds.Height * percentY),
                                                 0);
                }
                else
                {
                    LibXtst_32.XTestFakeMotionEvent(Display,
                                                    LibX11.XDefaultScreen(Display),
                                                    screenBounds.X + (int)(screenBounds.Width * percentX),
                                                    screenBounds.Y + (int)(screenBounds.Height * percentY),
                                                    0);
                }

                LibX11.XSync(Display, false);
            }
            catch (Exception ex)
            {
                Logger.Write(ex);
            }
        }
Exemplo n.º 2
0
 public void SendMouseMove(double percentX, double percentY, Viewer viewer)
 {
     try
     {
         LibXtst.XTestFakeMotionEvent(Display,
                                      viewer.Capturer.GetSelectedScreenIndex(),
                                      (int)(viewer.Capturer.CurrentScreenBounds.Width * percentX),
                                      (int)(viewer.Capturer.CurrentScreenBounds.Height * percentY),
                                      0);
         LibX11.XSync(Display, false);
     }
     catch (Exception ex)
     {
         Logger.Write(ex);
     }
 }
Exemplo n.º 3
0
 public uint SendMouseMove(double percentX, double percentY, Viewer viewer)
 {
     try
     {
         var capturer = new X11Capture(Display);
         LibXtst.XTestFakeMotionEvent(Display,
                                      viewer.Capturer.SelectedScreen,
                                      (int)(viewer.Capturer.CurrentScreenBounds.Width * percentX),
                                      (int)(viewer.Capturer.CurrentScreenBounds.Height * percentY),
                                      0);
         LibX11.XSync(Display, false);
     }
     catch (Exception ex)
     {
         Logger.Write(ex);
     }
     return(0);
 }