public static void MouseClick(NSView view, IControlMouseInteraction control, NSEvent theEvent, bool isRightButton) { var button = MouseButtonType.Right; if(!isRightButton) button = GetMouseButtonType(theEvent); var point = GetMouseLocation(view, theEvent); var keysHeld = GetKeysHeld(theEvent); //Console.WriteLine("GenericControlHelper - MouseClick - point: {0} bounds: {1}", point, view.Bounds); control.MouseClick(point.X, point.Y, button, keysHeld); }
public static void MouseClick(MouseEventArgs e, UIElement element, IControlMouseInteraction control) { var location = e.GetPosition(element); var keysHeld = GetKeysHeld(); float x = (float)location.X; float y = (float)location.Y; if (e.LeftButton == MouseButtonState.Pressed) control.MouseClick(x, y, MouseButtonType.Left, keysHeld); else if (e.MiddleButton == MouseButtonState.Pressed) control.MouseClick(x, y, MouseButtonType.Middle, keysHeld); else if (e.RightButton == MouseButtonState.Pressed) control.MouseClick(x, y, MouseButtonType.Right, keysHeld); }