Table of Contents

Class PointerEventArgs

Namespace
Avalonia.Input
Assembly
Avalonia.Base.dll
public class PointerEventArgs : RoutedEventArgs
Inheritance
PointerEventArgs
Derived
Inherited Members

Constructors

PointerEventArgs(RoutedEvent, object?, IPointer, Visual?, Point, ulong, PointerPointProperties, KeyModifiers)

[Unstable("This constructor might be removed in 12.0. For unit testing, consider using IHeadlessWindow mouse methods.")]
public PointerEventArgs(RoutedEvent routedEvent, object? source, IPointer pointer, Visual? rootVisual, Point rootVisualPosition, ulong timestamp, PointerPointProperties properties, KeyModifiers modifiers)

Parameters

routedEvent RoutedEvent
source object
pointer IPointer
rootVisual Visual
rootVisualPosition Point
timestamp ulong
properties PointerPointProperties
modifiers KeyModifiers

Properties

KeyModifiers

Gets a value that indicates which key modifiers were active at the time that the pointer event was initiated.

public KeyModifiers KeyModifiers { get; }

Property Value

KeyModifiers

Pointer

Gets specific pointer generated by input device.

public IPointer Pointer { get; }

Property Value

IPointer

Properties

Returns the current pointer point properties

protected PointerPointProperties Properties { get; }

Property Value

PointerPointProperties

Timestamp

Gets the time when the input occurred.

public ulong Timestamp { get; }

Property Value

ulong

Methods

GetCurrentPoint(Visual?)

Returns the PointerPoint associated with the current event

public PointerPoint GetCurrentPoint(Visual? relativeTo)

Parameters

relativeTo Visual

The visual whose coordinate system to use. Pass null for toplevel coordinate system

Returns

PointerPoint

GetIntermediatePoints(Visual?)

Returns the PointerPoint associated with the current event

public IReadOnlyList<PointerPoint> GetIntermediatePoints(Visual? relativeTo)

Parameters

relativeTo Visual

The visual which coordinate system to use. Pass null for toplevel coordinate system

Returns

IReadOnlyList<PointerPoint>

GetPosition(Visual?)

Gets the pointer position relative to a control.

public Point GetPosition(Visual? relativeTo)

Parameters

relativeTo Visual

The visual whose coordinate system to use. Pass null for toplevel coordinate system

Returns

Point

The pointer position in the control's coordinates.

PreventGestureRecognition()

Prevents this event from being handled by other gesture recognizers in the route

public void PreventGestureRecognition()