protected override void Initialize() { base.Initialize(); Widget.MouseDown += (sender, e) => { if (GlobalSettings.Settings.EnableCustomTouchBar) { if (NSProcessInfo.ProcessInfo.IsOperatingSystemAtLeastVersion(new NSOperatingSystemVersion(10, 12, 2))) { try { BindTouchBar(); nativecontrol.SetTouchBar(null); } catch { } } } var scale = (float)GlobalSettings.Settings.DpiScale; nativecontrol._lastTouchX = e.Location.X * scale; nativecontrol._lastTouchY = e.Location.Y * scale; nativecontrol.fsurface.InputPress((int)(nativecontrol._lastTouchX), (int)(nativecontrol._lastTouchY)); nativecontrol.NeedsDisplay = true; nativecontrol.BecomeFirstResponder(); nativecontrol.UpdateTrackingAreas(); }; }
protected override void Initialize() { base.Initialize(); Widget.MouseDown += (sender, e) => { //nativecontrol._lastTouchX = nativecontrol.ConvertPointFromView(theEvent.LocationInWindow, null).X; //nativecontrol._lastTouchY = nativecontrol.Bounds.Height - nativecontrol.ConvertPointFromView(theEvent.LocationInWindow, null).Y; nativecontrol._lastTouchX = e.Location.X; nativecontrol._lastTouchY = e.Location.Y; nativecontrol.fsurface.InputPress((int)(nativecontrol._lastTouchX), (int)(nativecontrol._lastTouchY)); nativecontrol.NeedsDisplay = true; nativecontrol.BecomeFirstResponder(); nativecontrol.UpdateTrackingAreas(); }; }
protected override void Initialize() { base.Initialize(); Widget.MouseDown += (sender, e) => { BindTouchBar(); nativecontrol.SetTouchBar(null); var scale = (float)GlobalSettings.Settings.DpiScale; nativecontrol._lastTouchX = e.Location.X * scale; nativecontrol._lastTouchY = e.Location.Y * scale; nativecontrol.fsurface.InputPress((int)(nativecontrol._lastTouchX), (int)(nativecontrol._lastTouchY)); nativecontrol.NeedsDisplay = true; nativecontrol.BecomeFirstResponder(); nativecontrol.UpdateTrackingAreas(); }; }