Browse Source

Allow right-click pen to select items on press

pull/18766/head
Max Katz 1 year ago
parent
commit
33fa96e36e
  1. 6
      src/Avalonia.Controls/ListBoxItem.cs

6
src/Avalonia.Controls/ListBoxItem.cs

@ -64,9 +64,11 @@ namespace Avalonia.Controls
if (p.Properties.PointerUpdateKind is PointerUpdateKind.LeftButtonPressed or if (p.Properties.PointerUpdateKind is PointerUpdateKind.LeftButtonPressed or
PointerUpdateKind.RightButtonPressed) PointerUpdateKind.RightButtonPressed)
{ {
if (p.Pointer.Type == PointerType.Mouse) if (p.Pointer.Type == PointerType.Mouse
|| (p.Pointer.Type == PointerType.Pen && p.Properties.IsRightButtonPressed))
{ {
// If the pressed point comes from a mouse, perform the selection immediately. // If the pressed point comes from a mouse or right-click pen, perform the selection immediately.
// In case of pen, only right-click is accepted, as left click (a tip touch) is used for scrolling.
e.Handled = owner.UpdateSelectionFromPointerEvent(this, e); e.Handled = owner.UpdateSelectionFromPointerEvent(this, e);
} }
else else

Loading…
Cancel
Save