Allow manipulation only without modifier keys

This commit is contained in:
ClemensFischer 2023-01-06 18:12:29 +01:00
parent e1c6bfdf9c
commit 42f824bcf4
2 changed files with 3 additions and 1 deletions

View file

@ -72,7 +72,7 @@ namespace MapControl
private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (CaptureMouse())
if (Keyboard.Modifiers == ModifierKeys.None && CaptureMouse())
{
mousePosition = e.GetPosition(this);
}

View file

@ -3,6 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
using Windows.System;
#if WINUI
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
@ -61,6 +62,7 @@ namespace MapControl
private void OnPointerPressed(object sender, PointerRoutedEventArgs e)
{
manipulationEnabled = e.Pointer.PointerDeviceType != PointerDeviceType.Mouse ||
e.KeyModifiers == VirtualKeyModifiers.None &&
e.GetCurrentPoint(this).Properties.IsLeftButtonPressed;
}