From 42f824bcf4780779e4f6a8e7caa6dbb6fcb8c689 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Fri, 6 Jan 2023 18:12:29 +0100 Subject: [PATCH] Allow manipulation only without modifier keys --- MapControl/WPF/Map.WPF.cs | 2 +- MapControl/WinUI/Map.WinUI.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MapControl/WPF/Map.WPF.cs b/MapControl/WPF/Map.WPF.cs index 6af5eb82..4e21f7da 100644 --- a/MapControl/WPF/Map.WPF.cs +++ b/MapControl/WPF/Map.WPF.cs @@ -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); } diff --git a/MapControl/WinUI/Map.WinUI.cs b/MapControl/WinUI/Map.WinUI.cs index 95494530..347a7968 100644 --- a/MapControl/WinUI/Map.WinUI.cs +++ b/MapControl/WinUI/Map.WinUI.cs @@ -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; }