-api-id | -api-type |
---|---|
T:Microsoft.UI.Input.PointerPoint |
winrt class |
Provides basic properties for the input pointer associated with a single mouse, pen/stylus, or touch contact.
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.
PointerPointProperties, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs
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;
}