PointerEventArgs PointerEventArgs PointerEventArgs Class

Contains the arguments returned by the last pointer event.

Syntax

Declaration

public sealed class PointerEventArgspublic sealed class PointerEventArgsPublic NotInheritable Class PointerEventArgs

Remarks

This object is returned by a delegate registered for one of the following events:


// returning pointer events data through PointerEventArgs

void MyCoreWindowEvents::SetWindow( // implementation called by CoreApplication::Run(), provided for context
    _In_ CoreWindow^ window
    )
{
    window->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0);

    // ...
    window->PointerPressed +=
        ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &CoreWindowEvents::OnPointerPressed);
    window->PointerReleased +=
        ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &CoreWindowEvents::OnPointerReleased);
    window->PointerMoved +=
        ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &CoreWindowEvents::OnPointerMoved);

    // ...

}
Note

: This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).

Properties summary

Gets the pointer data of the last pointer event.

Gets or sets whether the pointer event was handled.

Gets the keyboard key or keys used to modify the pointer input, such as the "Ctrl" key when pressed in conjunction with another key, as in Ctrl+C.

Methods summary

Retrieves the pointer data for up to the last 64 pointer locations since the last pointer event.

Properties

  • CurrentPoint
    CurrentPoint
    CurrentPoint
    CurrentPoint

    Gets the pointer data of the last pointer event.

    public PointerPoint CurrentPoint { get; }public PointerPoint CurrentPoint { get; }Public ReadOnly Property CurrentPoint As PointerPointpublic PointerPoint CurrentPoint { get; }

    Property Value

    Remarks

    CurrentPoint corresponds to the last point retrieved by GetIntermediatePoints().

    void MyCoreWindowEvents::GetPointerInfo(
        _In_ PointerEventArgs^ args
        )
    {
        Windows::UI::Input::PointerPoint^ currentPoint = args->CurrentPoint;
    
              // save or print currentPoint 
    
    }
    
  • Handled
    Handled
    Handled
    Handled

    Gets or sets whether the pointer event was handled.

    public bool Handled { get; set; }public bool Handled { get; set; }Public ReadWrite Property Handled As boolpublic bool Handled { get; set; }

    Property Value

    • bool
      bool
      bool

      True if the pointer event has been handled by the appropriate delegate; false if it has not.

  • KeyModifiers
    KeyModifiers
    KeyModifiers
    KeyModifiers

    Gets the keyboard key or keys used to modify the pointer input, such as the "Ctrl" key when pressed in conjunction with another key, as in Ctrl+C.

    public VirtualKeyModifiers KeyModifiers { get; }public VirtualKeyModifiers KeyModifiers { get; }Public ReadOnly Property KeyModifiers As VirtualKeyModifierspublic VirtualKeyModifiers KeyModifiers { get; }

    Property Value

Methods

  • GetIntermediatePoints()
    GetIntermediatePoints()
    GetIntermediatePoints()
    GetIntermediatePoints()

    Retrieves the pointer data for up to the last 64 pointer locations since the last pointer event.

    public IVector<PointerPoint> GetIntermediatePoints()public IVector<PointerPoint> GetIntermediatePoints()Public Function GetIntermediatePoints() As IVector( Of PointerPoint )public IVector<PointerPoint> GetIntermediatePoints()

    Returns

    • The data for each pointer.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Core.dll