ExpPointerPoint Class

Definition

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

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

public ref class ExpPointerPoint sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedExperimentalContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Microsoft.UI.Input.Experimental.IExpPointerPointStatics, 65536, "Microsoft.Foundation.LiftedExperimentalContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ExpPointerPoint final
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedExperimentalContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Microsoft.UI.Input.Experimental.IExpPointerPointStatics, 65536, "Microsoft.Foundation.LiftedExperimentalContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class ExpPointerPoint final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedExperimentalContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Microsoft.UI.Input.Experimental.IExpPointerPointStatics), 65536, "Microsoft.Foundation.LiftedExperimentalContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ExpPointerPoint
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedExperimentalContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Microsoft.UI.Input.Experimental.IExpPointerPointStatics), 65536, "Microsoft.Foundation.LiftedExperimentalContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class ExpPointerPoint
Public NotInheritable Class ExpPointerPoint
Inheritance
ExpPointerPoint
Attributes
Windows.Foundation.Metadata.ContractVersionAttribute Windows.Foundation.Metadata.MarshalingBehaviorAttribute Windows.Foundation.Metadata.StaticAttribute Windows.Foundation.Metadata.ThreadingAttribute Windows.Foundation.Metadata.WebHostHiddenAttribute

Examples

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

String queryPointer(ExpPointerPoint ptrPt)
{
    String details = "";

    switch (ptrPt.PointerDeviceType)
    {
        case Windows.Devices.Input.PointerDeviceType.Mouse:
            details += "\nPointer type: mouse";
            break;
        case Windows.Devices.Input.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 Windows.Devices.Input.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;
}

In this example we demonstrate how to find the system PointerDevice associated with an ExpPointerPoint object:

Windows.Devices.Input.PointerDevice getPointerDeviceFromPointPoint(ExpPointerPoint ptrPt)
{
    var pointerDeviceList = Windows.Devices.Input.PointerDevice.GetPointerDevices(); 

    foreach (Windows.Devices.Input.PointerDevice pointerDevice in pointerDeviceList) 
    { 
        if (pointerDevice.PointerDeviceType == ptrPt.PointerDeviceType)
        {
            return pointerDevice;
        }
    }  

    return null;
}

Remarks

See ExpPointerPointProperties for extended properties accessible through Properties.

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

Note

The PointerDevice is not directly accessible from the ExpPointerPoint object. See the examples for how to retrieve the PointerDevice if needed.

Note

This class is not agile, which means its functions and properties may only be accessed on the UI thread from where it was retrieved. Access on a different thread will return RPC_E_WRONG_THREAD or the equivalent projected error type.

Properties

FrameId

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Gets the ID of an input frame.

IsInContact

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

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

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Gets the input device type associated with the input pointer.

PointerId

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Gets a unique identifier for the input pointer.

Position

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Gets the location of the input pointer.

Properties

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Gets extended information about the input pointer.

RawPosition

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Gets the location of the input pointer as reported by the input device without any pointer prediction modifications.

Timestamp

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Gets the time when the input occurred.

Methods

GetCurrentPoint(UInt32)

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Retrieves position and state information for the specified pointer.

GetCurrentPointTransformed(UInt32, IPointerPointTransform)

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Retrieves the transformed position and state information for the specified pointer.

GetIntermediatePoints(UInt32)

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Retrieves position and state information for the specified pointer (from the last pointer event to the current pointer event, inclusive).

GetIntermediatePointsTransformed(UInt32, IPointerPointTransform)

Caution

This API is in development and considered experimental in the WinUI version selected. It might be altered or unavailable in other versions.

Retrieves the transformed position and state information for the specified pointer (from the last pointer event to the current pointer event, inclusive).

Applies to

See also