/// <summary>Performs a click in the center of the rect image object</summary> /// <param name="image">Rect image object to click</param> /// <param name="numberOfClicks">Amount of click to perform</param> public static void ClickImage(Rect image, int numberOfClicks = 1) { MouseHandler handler = new MouseHandler(); for (int i = 0; i < numberOfClicks; i++) { handler.Click(Center(image)); } }
/// <summary>Performs a click in the curren position of the mouse</summary> /// <param name="numberOfClicks">Amount of click to perform</param> public static void Click(int numberOfClicks = 1) { MouseHandler handler = new MouseHandler(); for (int i = 0; i < numberOfClicks; i++) { handler.Click(); } }
/// <summary>Performs a click in a given point in the screen</summary> /// <param name="point">The point to perform the click</param> /// <param name="numberOfClicks">Amount of click to perform</param> public static void Click(Point point, int numberOfClicks = 1) { point = FixPoint(point); MouseHandler handler = new MouseHandler(); for (int i = 0; i < numberOfClicks; i++) { handler.Click(point); } }
/// <summary>Looks for the given path of the image and performs a click in the center of the image</summary> /// <param name="path">Path of the image</param> /// <param name="numberOfClicks">Amount of click to perform</param> /// <param name="region">Region of the screen to look for the image, for more details look for ScreenRegions class</param> /// <param name="attempts">Amount of tries to look for the image in the screen</param> public static Rect ClickImage(string path, int numberOfClicks = 1, Rect region = null, int attempts = 1) { Rect image = Image.Find(path, region: region, attempts: attempts); MouseHandler handler = new MouseHandler(); if (image == null) { return(image); } for (int i = 0; i < numberOfClicks; i++) { handler.Click(Center(image)); } return(image); }
private void DoubleClick(object sender, RoutedEventArgs e) { dblClick = true; //Qnd o botão de duplo clique é iniciado, o mouse começa a ser vigiado. Se a flag estiver certinha, a função manda um click pro sistema assim que detectar uma mensagem ''WM_LBUTTONUP'' mouseWatcher.OnMouseInput += (s, r) => { //Console.WriteLine(r.Message.ToString()); if (dblClick == true) { if (r.Message.ToString() == "WM_LBUTTONUP") { mouse.Click(); Console.WriteLine("duplo clicoui porra!!"); dblClick = false; } } else { return; } }; }
public void ClickOnPoint(Point point) { _mouse.Click(point); }