public override void RightMouseDown(NSEvent theEvent) { var p = ConvertPointFromView(theEvent.LocationInWindow, null); ButtonEventArgs args = new ButtonEventArgs(); args.X = p.X; args.Y = p.Y; args.Button = PointerButton.Right; Toolkit.Invoke(delegate { eventSink.OnButtonPressed(args); }); }
public override void MouseDown(NSEvent theEvent) { var p = ConvertPointFromView(theEvent.LocationInWindow, null); ButtonEventArgs args = new ButtonEventArgs(); args.X = p.X; args.Y = p.Y; args.Button = theEvent.ButtonNumber + 1; eventSink.OnButtonPressed(args); }
void HandleWidgetButtonPressEvent(object o, Gtk.ButtonPressEventArgs args) { var a = new ButtonEventArgs(); a.X = args.Event.X; a.Y = args.Event.Y; a.Button = (int)args.Event.Button; if (args.Event.Type == Gdk.EventType.TwoButtonPress) { a.MultiplePress = 2; } else if (args.Event.Type == Gdk.EventType.ThreeButtonPress) { a.MultiplePress = 3; } else { a.MultiplePress = 1; } EventSink.OnButtonPressed(a); }