Provides basic properties for the input pointer associated with a single mouse, pen/stylus, or touch contact.
In most cases, we recommend that you obtain pointer info through the pointer event handlers of your chosen Windows 8 language framework (Windows Store apps using JavaScript, Windows Store apps built for Windows using C++, C#, or Visual Basic, or Windows Store apps built for Windows using DirectX with C++).
If the event argument doesn't expose the pointer details required by your app, you can get access to extended pointer data from the event argument through the getCurrentPoint and getIntermediatePoints methods or currentPoint and intermediatePoints properties. We recommend using the getCurrentPoint and getIntermediatePoints methods as you can specify the context of the pointer data.
The static PointerPoint methods, GetCurrentPoint and GetIntermediatePoints, always use the context of the app.
Syntax
public sealed class PointerPoint : Object
Attributes
- MarshalingBehaviorAttribute(None)
- StaticAttribute(Windows.UI.Input.IPointerPointStatics, NTDDI_WIN8)
- VersionAttribute(NTDDI_WIN8)
Members
The PointerPoint class has these types of members:
Methods
The PointerPoint class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| GetCurrentPoint(UInt32) | Retrieves position and state information for the specified pointer. |
| GetCurrentPoint(UInt32, IPointerPointTransform) | Retrieves the transformed information for the specified pointer. |
| GetIntermediatePoints(UInt32) | Retrieves position and state information for the specified pointer, from the last pointer event up to and including the current pointer event. |
| GetIntermediatePoints(UInt32, IPointerPointTransform) | Retrieves the transformed position and state information for the specified pointer, from the last pointer event up to and including the current pointer event. |
Properties
The PointerPoint class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the ID of an input frame. | |
| Read-only | Gets a value that indicates whether the physical entity (touch, pen/stylus, or mouse button) is pressed down. | |
| Read-only | Gets information about the device associated with the input pointer. | |
| Read-only | Gets a unique identifier for the input pointer. | |
| Read-only | Gets the location of the pointer input in client coordinates. | |
| Read-only | Gets extended information about the input pointer. | |
| Read-only | Gets the raw location of the pointer input in client coordinates. | |
| Read-only | Gets the time when the input occurred. |
Remarks
The PointerPoint class implements IPointerPoint.
See PointerPointProperties for extended properties accessible through Properties.
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) and Using Windows Runtime objects in a multithreaded environment (.NET).
Examples
In the following example, we query various pointer properties using a PointerPoint object.
String queryPointer(PointerPoint ptrPt)
{
String details = "";
switch (ptrPt.PointerDevice.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;
}
GeneralTransform gt = Target.TransformToVisual(page);
Point screenPoint;
screenPoint = gt.TransformPoint(new Point(ptrPt.Position.X, ptrPt.Position.Y));
details += "\nPointer Id: " + ptrPt.PointerId.ToString() +
"\nPointer location (parent): " + ptrPt.Position.X + ", " + ptrPt.Position.Y +
"\nPointer location (screen): " + screenPoint.X + ", " + screenPoint.Y;
return details;
}
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013