示例#1
0
        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 { }
                    }
                }
                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();
            };
        }
示例#2
0
        protected override void Initialize()
        {
            base.Initialize();

            Widget.MouseDown += (sender, e) =>
            {
                BindTouchBar();
                nativecontrol.SetTouchBar(null);
                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();
            };
        }