Browse Source

Dont open context menu when holding on one point

CPKreuz 4 years ago
parent
commit
3758ce7144

+ 12 - 0
PixiEditor/ViewModels/SubViewModels/Main/StylusViewModel.cs

@@ -14,10 +14,22 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
         public StylusViewModel(ViewModelMain owner)
         public StylusViewModel(ViewModelMain owner)
             : base(owner)
             : base(owner)
         {
         {
+            // TODO: Only capture it on the Drawing View Port
             Window mw = Application.Current.MainWindow;
             Window mw = Application.Current.MainWindow;
 
 
             mw.PreviewStylusButtonDown += Mw_StylusButtonDown;
             mw.PreviewStylusButtonDown += Mw_StylusButtonDown;
             mw.PreviewStylusButtonUp += Mw_StylusButtonUp;
             mw.PreviewStylusButtonUp += Mw_StylusButtonUp;
+            mw.PreviewStylusSystemGesture += Mw_PreviewStylusSystemGesture;
+        }
+
+        private void Mw_PreviewStylusSystemGesture(object sender, StylusSystemGestureEventArgs e)
+        {
+            if (e.SystemGesture == SystemGesture.Drag || e.SystemGesture == SystemGesture.Tap)
+            {
+                return;
+            }
+
+            e.Handled = true;
         }
         }
 
 
         private void Mw_StylusButtonDown(object sender, StylusButtonEventArgs e)
         private void Mw_StylusButtonDown(object sender, StylusButtonEventArgs e)

+ 2 - 1
PixiEditor/Views/MainWindow.xaml

@@ -236,7 +236,8 @@
                                         MouseMoveCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseMoveCommand}"
                                         MouseMoveCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseMoveCommand}"
                                         MouseDownCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseDownCommand}"
                                         MouseDownCommand="{Binding XamlAccesibleViewModel.IoSubViewModel.MouseDownCommand}"
                                         MouseXOnCanvas="{Binding MouseXOnCanvas, Mode=TwoWay}"
                                         MouseXOnCanvas="{Binding MouseXOnCanvas, Mode=TwoWay}"
-                                        MouseYOnCanvas="{Binding MouseYOnCanvas, Mode=TwoWay}">
+                                        MouseYOnCanvas="{Binding MouseYOnCanvas, Mode=TwoWay}"
+                                        Stylus.IsTapFeedbackEnabled="False" Stylus.IsTouchFeedbackEnabled="False">
                                         <i:Interaction.Triggers>
                                         <i:Interaction.Triggers>
                                             <i:EventTrigger EventName="PreviewMouseDown">
                                             <i:EventTrigger EventName="PreviewMouseDown">
                                                 <i:InvokeCommandAction Command="{Binding SetAsActiveOnClickCommand}"/>
                                                 <i:InvokeCommandAction Command="{Binding SetAsActiveOnClickCommand}"/>