Share via


PointerPoint Class

Definition

Provides basic properties for the input pointer associated with a single mouse, pen/stylus, or touch contact.

public ref class PointerPoint sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PointerPoint final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PointerPoint
Public NotInheritable Class PointerPoint
Inheritance
Object Platform::Object IInspectable PointerPoint
Attributes

Examples

In the following example, we query various pointer properties using a PointerPoint object.

private string queryPointer(PointerPoint ptrPt)
{
    String details = "";

    switch (ptrPt.PointerDeviceType)
    {
        case PointerDeviceType.Mouse:
            details += "\nPointer type: mouse";
            break;
        case PointerDeviceType.Pen:
            details += "\nPointer type: pen";
            if (ptrPt.IsInContact)
            {
                details += "\nPressure: " + ptrPt.Properties.Pressure;
                details += "\nrotation: " + ptrPt.Properties.Orientation;
                details += "\nTilt X: " + ptrPt.Properties.XTilt;
                details += "\nTilt Y: " + ptrPt.Properties.YTilt;
                details += "\nBarrel button pressed: " + ptrPt.Properties.IsBarrelButtonPressed;
            }
            break;
        case PointerDeviceType.Touch:
            details += "\nPointer type: touch";
            details += "\nrotation: " + ptrPt.Properties.Orientation;
            details += "\nTilt X: " + ptrPt.Properties.XTilt;
            details += "\nTilt Y: " + ptrPt.Properties.YTilt;
            break;
        default:
            details += "\nPointer type: n/a";
            break;
    }

    details += "\nPointer Id: " + ptrPt.PointerId.ToString() +
        "\nPointer location: " + ptrPt.Position.X + ", " + ptrPt.Position.Y;

    return details;
}

Remarks

See PointerPointProperties for extended properties accessible through Properties.

The PointerPoint coordinate space is dependent on the context in which it is retrieved. When retrieved from PointerRoutedEventArgs.GetCurrentPoint, the coordinates of the pointer will be relative to the provided UIElement in device independent pixels.

Properties

FrameId

Gets the ID of an input frame.

IsInContact

Gets a value that indicates whether the input device (touch, pen/stylus) is pressing down on (touching) the digitizer surface, or a mouse button is pressed down.

PointerDeviceType

Gets the input device type associated with the input pointer.

PointerId

Gets a unique identifier for the input pointer.

Position

Gets the location of the input pointer.

Properties

Gets extended information about the input pointer.

Timestamp

Gets the time when the input occurred.

Methods

GetTransformedPoint(IPointerPointTransform)

Retrieves a new PointerPoint object by transforming the current PointerPoint with an application-defined transform.

Applies to

See also