Input handling in Avalonia Map and MapItem

This commit is contained in:
ClemensFischer 2025-03-19 17:16:22 +01:00
parent f2d82e910b
commit 1bb03e1102
3 changed files with 22 additions and 20 deletions

View file

@ -57,15 +57,16 @@ namespace MapControl
}
}
internal void UpdateSelection(MapItem mapItem, bool controlKeyPressed, bool shiftKeyPressed)
internal void UpdateSelection(MapItem mapItem, PointerEventArgs e)
{
if (SelectionMode != SelectionMode.Single && shiftKeyPressed)
if (SelectionMode != SelectionMode.Single &&
e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
SelectItemsInRange(mapItem);
}
else
{
UpdateSelection(mapItem, true, false, controlKeyPressed);
UpdateSelection(mapItem, true, false, e.KeyModifiers.HasFlag(KeyModifiers.Control));
}
}
}