public void Init() { try { var defaultScreen = LibX11.XDefaultScreen(Display); SetSelectedScreen(defaultScreen); CurrentFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb); PreviousFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb); } catch (Exception ex) { Logger.Write(ex); } }
public void SendMouseMove(double percentX, double percentY, Viewer viewer) { try { InitDisplay(); var screenBounds = viewer.Capturer.CurrentScreenBounds; LibXtst.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); } }