PointerPointProperties PointerPointProperties PointerPointProperties PointerPointProperties Class

Provides extended properties for a PointerPoint object.

In most cases, we recommend that you obtain pointer info through the pointer event handlers of your chosen Windows 8 language framework (Windows app using JavaScript, Windows Store app using C++, C#, or Visual Basic, or Windows Store app 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(UInt32) and GetIntermediatePoints(UInt32), always use the context of the app.

Syntax

Declaration

public sealed class PointerPointPropertiespublic sealed class PointerPointPropertiesPublic NotInheritable Class PointerPointPropertiespublic sealed class PointerPointProperties

Remarks

The PointerPointProperties class implements IPointerPointProperties.

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).

The core of the Microsoft interactive input device architecture is based on the Universal Serial Bus (USB) standard Device Class Definition for Human Interface Device (HID), which is defined by the Implementers Forum, Inc.

The Universal Serial Bus (USB) Human Interface Device (HID) standard defines the configuration and communication protocols for Human Interface Device (HID), such as keyboards, mouse devices, joysticks, and virtual reality devices, that humans use to enter data directly into a computer. (For detailed information about the USB HID standard, see the USB Implementers Forum website.)

Although the core of the Windows input architecture is based on the Universal Serial Bus (USB) Human Interface Device (HID) standard, the architecture is not limited to Universal Serial Bus (USB) devices. The input architecture also supports serial port devices, i8042 port devices, and proprietary input devices.

Examples

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

// Get extended pointer data.
function queryPointer(e) {
    // We get the extended pointer info through the getCurrentPoint method
    // of the event argument. (We recommend using getCurrentPoint 
    // to ensure the coordinate space is in relation to the target.)
    // Note: getCurrentPoint and currentPoint are only available in the 
    // local compartment, they are not available in the web compartment.
    var pt = e.getCurrentPoint(e.currentTarget);
    var ptTargetProperties = pt.properties;

    var details = "Pointer Id: " + e.pointerId;
    switch (e.pointerType) {
        case "mouse":
            details += "\nPointer type: mouse";
            details += "\nLeft button: " + ptTargetProperties.isLeftButtonPressed;
            details += "\nRight button: " + ptTargetProperties.isRightButtonPressed;
            details += "\nWheel button: " + ptTargetProperties.isMiddleButtonPressed;
            details += "\nX1 button: " + ptTargetProperties.isXButton1Pressed;
            details += "\nX2 button: " + ptTargetProperties.isXButton2Pressed;
            break;
        case "pen":
            details += "\nPointer type: pen";
            if (pt.isInContact) {
                details += "\nPressure: " + ptTargetProperties.pressure;
                details += "\nrotation: " + ptTargetProperties.rotation;
                details += "\nTilt X: " + ptTargetProperties.tiltX;
                details += "\nTilt Y: " + ptTargetProperties.tiltY;
                details += "\nBarrel button pressed: " + ptTargetProperties.isBarrelButtonPressed;
            }
            break;
        case "touch":
            details += "\nPointer type: touch";
            details += "\nPressure: " + ptTargetProperties.pressure;
            details += "\nrotation: " + ptTargetProperties.rotation;
            details += "\nTilt X: " + ptTargetProperties.tiltX;
            details += "\nTilt Y: " + ptTargetProperties.tiltY;
            break;
        default:
            details += "\nPointer type: " + "n/a";
            break;
    }
    details += "\nPointer location (target): " + e.offsetX + ", " + e.offsetY;
    details += "\nPointer location (screen): " + e.screenX + ", " + e.screenY;

    return details;
}
// Get extended pointer data.
function queryPointer(e) {
    // We get the extended pointer info through the getCurrentPoint method
    // of the event argument. (We recommend using getCurrentPoint 
    // to ensure the coordinate space is in relation to the target.)
    // Note: getCurrentPoint and currentPoint are only available in the 
    // local compartment, they are not available in the web compartment.
    var pt = e.getCurrentPoint(e.currentTarget);
    var ptTargetProperties = pt.properties;

    var details = "Pointer Id: " + e.pointerId;
    switch (e.pointerType) {
        case "mouse":
            details += "\nPointer type: mouse";
            details += "\nLeft button: " + ptTargetProperties.isLeftButtonPressed;
            details += "\nRight button: " + ptTargetProperties.isRightButtonPressed;
            details += "\nWheel button: " + ptTargetProperties.isMiddleButtonPressed;
            details += "\nX1 button: " + ptTargetProperties.isXButton1Pressed;
            details += "\nX2 button: " + ptTargetProperties.isXButton2Pressed;
            break;
        case "pen":
            details += "\nPointer type: pen";
            if (pt.isInContact) {
                details += "\nPressure: " + ptTargetProperties.pressure;
                details += "\nrotation: " + ptTargetProperties.rotation;
                details += "\nTilt X: " + ptTargetProperties.tiltX;
                details += "\nTilt Y: " + ptTargetProperties.tiltY;
                details += "\nBarrel button pressed: " + ptTargetProperties.isBarrelButtonPressed;
            }
            break;
        case "touch":
            details += "\nPointer type: touch";
            details += "\nPressure: " + ptTargetProperties.pressure;
            details += "\nrotation: " + ptTargetProperties.rotation;
            details += "\nTilt X: " + ptTargetProperties.tiltX;
            details += "\nTilt Y: " + ptTargetProperties.tiltY;
            break;
        default:
            details += "\nPointer type: " + "n/a";
            break;
    }
    details += "\nPointer location (target): " + e.offsetX + ", " + e.offsetY;
    details += "\nPointer location (screen): " + e.screenX + ", " + e.screenY;

    return details;
}
function queryPointer(e) {
    /// <summary>
    /// Get extended pointer data.
    /// </summary>
    /// <param name="e" type="Event">The event argument.</param>

    // We get the extended pointer info through the getCurrentPoint method
    // of the event argument. (We recommend using getCurrentPoint 
    // to ensure the coordinate space is in relation to the target.)
    // Note: getCurrentPoint and currentPoint are only available in the 
    // local compartment, they are not available in the web compartment.

    var pt = e.getCurrentPoint(e.currentTarget);
    var ptTargetProperties = pt.properties;

    var details = "Pointer Id: " + e.pointerId;
    switch (e.pointerType) {
        case "mouse":
            details += "\nPointer type: mouse";
            details += "\nLeft button: " + ptTargetProperties.isLeftButtonPressed;
            details += "\nRight button: " + ptTargetProperties.isRightButtonPressed;
            details += "\nWheel button: " + ptTargetProperties.isMiddleButtonPressed;
            details += "\nX1 button: " + ptTargetProperties.isXButton1Pressed;
            details += "\nX2 button: " + ptTargetProperties.isXButton2Pressed;
            break;
        case "pen":
            details += "\nPointer type: pen";
            if (pt.isInContact) {
                details += "\nPressure: " + ptTargetProperties.pressure;
                details += "\nrotation: " + ptTargetProperties.rotation;
                details += "\nTilt X: " + ptTargetProperties.xtilt;
                details += "\nTilt Y: " + ptTargetProperties.ytilt;
                details += "\nBarrel button pressed: " + ptTargetProperties.isBarrelButtonPressed;
            }
            break;
        case "touch":
            details += "\nPointer type: touch";
            details += "\nPressure: " + ptTargetProperties.pressure;
            details += "\nrotation: " + ptTargetProperties.rotation;
            details += "\nTilt X: " + ptTargetProperties.xtilt;
            details += "\nTilt Y: " + ptTargetProperties.ytilt;
            break;
        default:
            details += "\nPointer type: " + "n/a";
            break;
    }
    details += "\nPointer location (target): " + e.offsetX + ", " + e.offsetY;
    details += "\nPointer location (screen): " + e.screenX + ", " + e.screenY;

    return details;
}
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;
}
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;
}

Properties summary

Gets the bounding rectangle of the contact area (typically from touch input).

Gets the bounding rectangle of the raw input (typically from touch input).

Gets a value that indicates whether the barrel button of the pen/stylus device is pressed.

Gets a value that indicates whether the input was canceled by the pointer device.

Gets a value that indicates whether the input is from a digitizer eraser.

Gets a value that indicates whether the input is from a mouse tilt wheel.

Gets a value that indicates whether the pointer device is within detection range of a sensor or digitizer.

Gets a value that indicates whether the digitizer pen is inverted.

Gets a value that indicates whether the input is from the left button of a mouse or other input method.

Gets a value that indicates whether the input is from the middle button of a mouse or other input method.

Gets a value that indicates whether the input is from the primary pointer when multiple pointers are registered.

Gets a value that indicates whether the input is from the right button of a mouse or other input method.

Gets the pressed state of the first extended mouse button.

Gets the pressed state of the second extended mouse button.

Gets a value (the raw value reported by the device) that indicates the change in wheel button input from the last pointer event.

Gets the counter-clockwise angle of rotation around the major axis of the pointer device (the z-axis, perpendicular to the surface of the digitizer). A value of 0.0 degrees indicates the device is oriented towards the top of the digitizer.

Gets the kind of pointer state change.

Gets a value that indicates the force that the pointer device (typically a pen/stylus) exerts on the surface of the digitizer.

Gets a value that indicates whether the pointer device rejected the touch contact.

Gets the clockwise rotation in degrees of a pen device around its own major axis (such as when the user spins the pen in their fingers).

Gets the plane angle between the Y-Z plane and the plane that contains the Y axis and the axis of the input device (typically a pen/stylus).

Gets the plane angle between the X-Z plane and the plane that contains the X axis and the axis of the input device (typically a pen/stylus).

Gets the z-coordinate (or distance) of the pointer from the screen surface, in device-independent pixels.

Methods summary

Gets the Human Interface Device (HID) usage value of the raw input.

Gets a value that indicates whether the input data from the pointer device contains the specified Human Interface Device (HID) usage information.

Properties

  • ContactRect
    ContactRect
    ContactRect
    ContactRect

    Gets the bounding rectangle of the contact area (typically from touch input).

    public Rect ContactRect { get; }public Rect ContactRect { get; }Public ReadOnly Property ContactRect As Rectpublic Rect ContactRect { get; }

    Property Value

    • The bounding rectangle of the contact area, using client window coordinates in device-independent pixel (DIP).

    Remarks

    ContactRect contains the bounding rectangle of the contact area as interpreted by the system. Under some circumstances, such as input prediction, this data can be modified by the system to compensate for hardware latency or message latency due to inherent delays in sensing and processing the pointer location on the digitizer.

    See ContactRectRaw for more information on raw input data.

  • ContactRectRaw
    ContactRectRaw
    ContactRectRaw
    ContactRectRaw

    Gets the bounding rectangle of the raw input (typically from touch input).

    public Rect ContactRectRaw { get; }public Rect ContactRectRaw { get; }Public ReadOnly Property ContactRectRaw As Rectpublic Rect ContactRectRaw { get; }

    Property Value

    • The bounding rectangle of the raw input, in device-independent pixel (DIP)

    Remarks

    ContactRectRaw contains the bounding rectangle of the raw input as reported by the input device. Under some circumstances, such as input prediction, this data can be modified by the system to compensate for hardware latency or message latency due to inherent delays in sensing and processing the pointer location on the digitizer.

    See ContactRect for more information on handling modified input data.

  • IsBarrelButtonPressed
    IsBarrelButtonPressed
    IsBarrelButtonPressed
    IsBarrelButtonPressed

    Gets a value that indicates whether the barrel button of the pen/stylus device is pressed.

    public bool IsBarrelButtonPressed { get; }public bool IsBarrelButtonPressed { get; }Public ReadOnly Property IsBarrelButtonPressed As boolpublic bool IsBarrelButtonPressed { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the barrel button is pressed; otherwise false.

  • IsCanceled
    IsCanceled
    IsCanceled
    IsCanceled

    Gets a value that indicates whether the input was canceled by the pointer device.

    public bool IsCanceled { get; }public bool IsCanceled { get; }Public ReadOnly Property IsCanceled As boolpublic bool IsCanceled { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the input was canceled; otherwise false.

    Remarks

    Pointer input can be canceled for various reasons, including:

    • Palm rejection
    • Input arbitration (such as pen/stylus proximity overriding touch input)
    • Device removal
    • Invalid state transition
    • Screen rotation
    • Desktop switching
  • IsEraser
    IsEraser
    IsEraser
    IsEraser

    Gets a value that indicates whether the input is from a digitizer eraser.

    public bool IsEraser { get; }public bool IsEraser { get; }Public ReadOnly Property IsEraser As boolpublic bool IsEraser { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the input is from a digitizer eraser; otherwise false.

  • IsHorizontalMouseWheel
    IsHorizontalMouseWheel
    IsHorizontalMouseWheel
    IsHorizontalMouseWheel

    Gets a value that indicates whether the input is from a mouse tilt wheel.

    public bool IsHorizontalMouseWheel { get; }public bool IsHorizontalMouseWheel { get; }Public ReadOnly Property IsHorizontalMouseWheel As boolpublic bool IsHorizontalMouseWheel { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the input is from a mouse tilt wheel; otherwise false.

  • IsInRange
    IsInRange
    IsInRange
    IsInRange

    Gets a value that indicates whether the pointer device is within detection range of a sensor or digitizer.

    public bool IsInRange { get; }public bool IsInRange { get; }Public ReadOnly Property IsInRange As boolpublic bool IsInRange { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if touch or pen is within detection range or mouse is over; otherwise false.

    Remarks

    A pointer comes into existence when the pointer device enters detection range and is canceled when the pointer device leaves detection range.

  • IsInverted
    IsInverted
    IsInverted
    IsInverted

    Gets a value that indicates whether the digitizer pen is inverted.

    public bool IsInverted { get; }public bool IsInverted { get; }Public ReadOnly Property IsInverted As boolpublic bool IsInverted { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if inverted; otherwise false.

  • IsLeftButtonPressed
    IsLeftButtonPressed
    IsLeftButtonPressed
    IsLeftButtonPressed

    Gets a value that indicates whether the input is from the left button of a mouse or other input method.

    public bool IsLeftButtonPressed { get; }public bool IsLeftButtonPressed { get; }Public ReadOnly Property IsLeftButtonPressed As boolpublic bool IsLeftButtonPressed { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the left button is pressed; otherwise false.

  • IsMiddleButtonPressed
    IsMiddleButtonPressed
    IsMiddleButtonPressed
    IsMiddleButtonPressed

    Gets a value that indicates whether the input is from the middle button of a mouse or other input method.

    public bool IsMiddleButtonPressed { get; }public bool IsMiddleButtonPressed { get; }Public ReadOnly Property IsMiddleButtonPressed As boolpublic bool IsMiddleButtonPressed { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the middle button is pressed; otherwise false.

  • IsPrimary
    IsPrimary
    IsPrimary
    IsPrimary

    Gets a value that indicates whether the input is from the primary pointer when multiple pointers are registered.

    public bool IsPrimary { get; }public bool IsPrimary { get; }Public ReadOnly Property IsPrimary As boolpublic bool IsPrimary { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the input is from the pointer designated as primary; otherwise false.

    Remarks

    The primary pointer is a single pointer (touch, mouse, and pen/stylus) in the current interaction.

    For mouse, the primary pointer is the only pointer for which mouse events can be generated.

    For touch, the primary pointer is the first contact in an interaction. A new primary pointer is only registered when all contacts in that interaction are removed and a new contact is subsequently detected.

    A primary pointer can perform actions that are not available to other pointers. For example, the primary pointer can send a WM_POINTERACTIVATE message.

    Examples

    For any interaction, IsPrimary returns false after the first pointerdown event. Use the pointerType property as shown in the following example when you need to know whether a pointer is primary, such as a mouse pointer.

    function isreallyprimary (event) {
      if (event.isPrimary) {
        return (true);
      } else {
        if (event.pointerType == event.MSPOINTER_TYPE_MOUSE) {
          return (true);
        } else {
          return (false);
        }
      }
    }
    
  • IsRightButtonPressed
    IsRightButtonPressed
    IsRightButtonPressed
    IsRightButtonPressed

    Gets a value that indicates whether the input is from the right button of a mouse or other input method.

    public bool IsRightButtonPressed { get; }public bool IsRightButtonPressed { get; }Public ReadOnly Property IsRightButtonPressed As boolpublic bool IsRightButtonPressed { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the right button is pressed; otherwise false.

  • IsXButton1Pressed
    IsXButton1Pressed
    IsXButton1Pressed
    IsXButton1Pressed

    Gets the pressed state of the first extended mouse button.

    public bool IsXButton1Pressed { get; }public bool IsXButton1Pressed { get; }Public ReadOnly Property IsXButton1Pressed As boolpublic bool IsXButton1Pressed { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the button is pressed; otherwise false.

    Remarks

    XBUTTON1 is an additional button used on many mouse devices. It returns the same data as standard mouse buttons.

  • IsXButton2Pressed
    IsXButton2Pressed
    IsXButton2Pressed
    IsXButton2Pressed

    Gets the pressed state of the second extended mouse button.

    public bool IsXButton2Pressed { get; }public bool IsXButton2Pressed { get; }Public ReadOnly Property IsXButton2Pressed As boolpublic bool IsXButton2Pressed { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the button is pressed; otherwise false.

    Remarks

    XBUTTON2 is an additional button used on many mouse devices. It returns the same data as standard mouse buttons.

  • MouseWheelDelta
    MouseWheelDelta
    MouseWheelDelta
    MouseWheelDelta

    Gets a value (the raw value reported by the device) that indicates the change in wheel button input from the last pointer event.

    public int MouseWheelDelta { get; }public int MouseWheelDelta { get; }Public ReadOnly Property MouseWheelDelta As intpublic int MouseWheelDelta { get; }

    Property Value

    • int
      int
      int
      int

      The number of notches or distance thresholds crossed since the last pointer event. The default value is 0.

    Remarks

    The mouse wheel button has discrete, evenly spaced notches or distance thresholds (also called detents). When you rotate or tilt the wheel, a wheel message is sent as each detent is encountered.

    The windows constant, WHEEL_DELTA (defined as a value of 120), describes one detent. Each detent marks the threshold for a single increment of an associated action (for example, scrolling a line or page).

    A positive value indicates that the wheel was rotated forward (away from the user) or tilted to the right; a negative value indicates that the wheel was rotated backward (toward the user) or tilted to the left.

    Wheel button input is oriented along the vertical axis (rotate forward or backward) or the horizontal axis (tilt left or right). Check IsHorizontalMouseWheel to identify whether the input is along the horizontal axis.

    Note

    The delta was set to 120 to enable finer-resolution wheels (such as freely-rotating wheels with no notches) that send more messages per rotation, but with smaller values per message.

  • Orientation
    Orientation
    Orientation
    Orientation

    Gets the counter-clockwise angle of rotation around the major axis of the pointer device (the z-axis, perpendicular to the surface of the digitizer). A value of 0.0 degrees indicates the device is oriented towards the top of the digitizer.

    public float Orientation { get; }public float Orientation { get; }Public ReadOnly Property Orientation As floatpublic float Orientation { get; }

    Property Value

    • float
      float
      float
      float

      A value between 0.0 and 359.0 in degrees of rotation. The default value is 0.0.

    Remarks

    Orientation is also referred to as azimuth.

  • PointerUpdateKind
    PointerUpdateKind
    PointerUpdateKind
    PointerUpdateKind

    Gets the kind of pointer state change.

    public PointerUpdateKind PointerUpdateKind { get; }public PointerUpdateKind PointerUpdateKind { get; }Public ReadOnly Property PointerUpdateKind As PointerUpdateKindpublic PointerUpdateKind PointerUpdateKind { get; }

    Property Value

  • Pressure
    Pressure
    Pressure
    Pressure

    Gets a value that indicates the force that the pointer device (typically a pen/stylus) exerts on the surface of the digitizer.

    public float Pressure { get; }public float Pressure { get; }Public ReadOnly Property Pressure As floatpublic float Pressure { get; }

    Property Value

    • float
      float
      float
      float

      A value from 0 to 1.0. The default value is 0.5.

    Remarks

    A device reports pressure information through the Human Interface Device (HID) tip pressure usage. Pressure is set through the value of this usage.

    Note
  • TouchConfidence
    TouchConfidence
    TouchConfidence
    TouchConfidence

    Gets a value that indicates whether the pointer device rejected the touch contact.

    public bool TouchConfidence { get; }public bool TouchConfidence { get; }Public ReadOnly Property TouchConfidence As boolpublic bool TouchConfidence { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the touch contact was accepted; otherwise false.

    Remarks

    A device rejects accidental touches and reports this information through the Human Interface Device (HID) confidence usage (see note above). TouchConfidence is set through the value of this usage.

    The confidence usage helps improve the accuracy and reliability of accidental touch rejection. (In addition to confidence, additional heuristics are applied to the touch input stream to improve the accuracy of accidental touch rejection.)

    Touch input is most often rejected due to palm detection or through input arbitration (such as when pen/stylus proximity overrides touch input).

  • Twist
    Twist
    Twist
    Twist

    Gets the clockwise rotation in degrees of a pen device around its own major axis (such as when the user spins the pen in their fingers).

    public float Twist { get; }public float Twist { get; }Public ReadOnly Property Twist As floatpublic float Twist { get; }

    Property Value

    • float
      float
      float
      float

      A value between 0.0 and 359.0 in degrees of rotation. The default value is 0.0.

  • XTilt
    XTilt
    XTilt
    XTilt

    Gets the plane angle between the Y-Z plane and the plane that contains the Y axis and the axis of the input device (typically a pen/stylus).

    public float XTilt { get; }public float XTilt { get; }Public ReadOnly Property XTilt As floatpublic float XTilt { get; }

    Property Value

    • float
      float
      float
      float

      The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted to the right of perpendicular, and between 0.0 and -90.0 when tilted to the left of perpendicular. The default value is 0.0.

    Remarks

    This property is used in conjunction with YTilt to indicate the tilt away from normal of the input device.

  • YTilt
    YTilt
    YTilt
    YTilt

    Gets the plane angle between the X-Z plane and the plane that contains the X axis and the axis of the input device (typically a pen/stylus).

    public float YTilt { get; }public float YTilt { get; }Public ReadOnly Property YTilt As floatpublic float YTilt { get; }

    Property Value

    • float
      float
      float
      float

      The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted towards the user, and between 0.0 and -90.0 when tilted away from the user. The default value is 0.0.

    Remarks

    This property is used in conjunction with XTilt to indicate the tilt away from normal of the input device.

  • ZDistance
    ZDistance
    ZDistance
    ZDistance

    Gets the z-coordinate (or distance) of the pointer from the screen surface, in device-independent pixels.

    public IReference<float> ZDistance { get; }public IReference<float> ZDistance { get; }Public ReadOnly Property ZDistance As IReference<float>public IReference<float> ZDistance { get; }

    Property Value

    • The value is null when the pointer is not within detection range or when MaxPointersWithZDistance is zero. The default value is null.

Methods

  • GetUsageValue(UInt32, UInt32)
    GetUsageValue(UInt32, UInt32)
    GetUsageValue(UInt32, UInt32)
    GetUsageValue(UInt32, UInt32)

    Gets the Human Interface Device (HID) usage value of the raw input.

    public int GetUsageValue(UInt32 usagePage, UInt32 usageId)public int GetUsageValue(UInt32 usagePage, UInt32 usageId)Public Function GetUsageValue(usagePage As UInt32, usageId As UInt32) As intpublic int GetUsageValue(UInt32 usagePage, UInt32 usageId)

    Parameters

    • usagePage
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The Human Interface Device (HID) usage page of the pointer device. Usage pages specify the class of device. For example, touch digitizers (0x0D) and generic input (0x01).

    • usageId
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      Indicates a usage in a usage page.Usage ID specify a device or property in the usagePage. For example, for touch digitizers this includes tip switch (0x42) to indicate finger contact or tip pressure (0x30).

    Returns

    • int
      int
      int
      int

      The extended usage of the raw input pointer.

  • HasUsage(UInt32, UInt32)
    HasUsage(UInt32, UInt32)
    HasUsage(UInt32, UInt32)
    HasUsage(UInt32, UInt32)

    Gets a value that indicates whether the input data from the pointer device contains the specified Human Interface Device (HID) usage information.

    public bool HasUsage(UInt32 usagePage, UInt32 usageId)public bool HasUsage(UInt32 usagePage, UInt32 usageId)Public Function HasUsage(usagePage As UInt32, usageId As UInt32) As boolpublic bool HasUsage(UInt32 usagePage, UInt32 usageId)

    Parameters

    • usagePage
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The Human Interface Device (HID) usage page of the pointer device. Usage pages specify the class of device. For example, touch digitizers (0x0D) and generic input (0x01).

    • usageId
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      Indicates a usage in a usage page.Usage ID specify a device or property in the usagePage. For example, for touch digitizers this includes tip switch (0x42) to indicate finger contact or tip pressure (0x30).

    Returns

    • bool
      bool
      bool
      bool

      True if the input data includes usage information; otherwise false.

    Remarks

    PointerPoint and PointerPointProperties expose common Human Interface Device (HID) usages directly.

    Use HasUsage(UInt32, UInt32) to query for additional, custom, and device-specific usages or when you need to verify that a device actually supports a property (where PointerPoint and PointerPointProperties return a default value).

    The following table lists the Human Interface Device (HID) usages that are exposed directly through PointerPoint and @Windows.UI.Input.PointerPointProperties.<table> PropertyUsage PageUsage Position 0x010x30 Position 0x010x31 RawPosition 0x010x30 RawPosition 0x010x31 IsInContact 0x0D0x42 (tip) or 0x45 (eraser tip) Pressure 0x0D0x30 IsInverted 0x0D0x3C IsEraser 0x0D0x45 Orientation 0x0D0x3F XTilt 0x0D0x3D YTilt 0x0D0x3E Twist 0x0D0x41 ContactRect 0x0D0x48 ContactRect 0x0D0x49 ContactRectRaw 0x0D0x48 ContactRectRaw 0x0D0x49 TouchConfidence 0x0D0x47 IsInRange 0x0D0x32

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

Details

Assembly

Windows.UI.Input.dll