Pointer​Point​Properties Pointer​Point​Properties Pointer​Point​Properties Class

Definition

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 and GetIntermediatePoints, always use the context of the app.

public sealed class PointerPointProperties : IPointerPointProperties, IPointerPointProperties2public sealed class PointerPointProperties : IPointerPointProperties, IPointerPointProperties2Public NotInheritable Class PointerPointProperties Implements IPointerPointProperties, IPointerPointProperties2
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

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 Rect
Value
Rect Rect Rect

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

Attributes

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

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 Rect
Value
Rect Rect Rect

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

Attributes

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

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

public PlatForm::Boolean IsBarrelButtonPressed { get; }public bool IsBarrelButtonPressed { get; }Public ReadOnly Property IsBarrelButtonPressed As bool
Value
bool bool bool

True if the barrel button is pressed; otherwise false.

Attributes

IsCanceled IsCanceled IsCanceled

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

public PlatForm::Boolean IsCanceled { get; }public bool IsCanceled { get; }Public ReadOnly Property IsCanceled As bool
Value
bool bool bool

True if the input was canceled; otherwise false.

Attributes

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

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

public PlatForm::Boolean IsEraser { get; }public bool IsEraser { get; }Public ReadOnly Property IsEraser As bool
Value
bool bool bool

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

Attributes

IsHorizontalMouseWheel IsHorizontalMouseWheel IsHorizontalMouseWheel

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

public PlatForm::Boolean IsHorizontalMouseWheel { get; }public bool IsHorizontalMouseWheel { get; }Public ReadOnly Property IsHorizontalMouseWheel As bool
Value
bool bool bool

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

Attributes

IsInRange IsInRange IsInRange

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

public PlatForm::Boolean IsInRange { get; }public bool IsInRange { get; }Public ReadOnly Property IsInRange As bool
Value
bool bool bool

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

Attributes

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

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

public PlatForm::Boolean IsInverted { get; }public bool IsInverted { get; }Public ReadOnly Property IsInverted As bool
Value
bool bool bool

True if inverted; otherwise false.

Attributes

IsLeftButtonPressed IsLeftButtonPressed IsLeftButtonPressed

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

public PlatForm::Boolean IsLeftButtonPressed { get; }public bool IsLeftButtonPressed { get; }Public ReadOnly Property IsLeftButtonPressed As bool
Value
bool bool bool

True if the left button is pressed; otherwise false.

Attributes

IsMiddleButtonPressed IsMiddleButtonPressed IsMiddleButtonPressed

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

public PlatForm::Boolean IsMiddleButtonPressed { get; }public bool IsMiddleButtonPressed { get; }Public ReadOnly Property IsMiddleButtonPressed As bool
Value
bool bool bool

True if the middle button is pressed; otherwise false.

Attributes

IsPrimary IsPrimary IsPrimary

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

public PlatForm::Boolean IsPrimary { get; }public bool IsPrimary { get; }Public ReadOnly Property IsPrimary As bool
Value
bool bool bool

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

Attributes

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

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

public PlatForm::Boolean IsRightButtonPressed { get; }public bool IsRightButtonPressed { get; }Public ReadOnly Property IsRightButtonPressed As bool
Value
bool bool bool

True if the right button is pressed; otherwise false.

Attributes

IsXButton1Pressed IsXButton1Pressed IsXButton1Pressed

Gets the pressed state of the first extended mouse button.

public PlatForm::Boolean IsXButton1Pressed { get; }public bool IsXButton1Pressed { get; }Public ReadOnly Property IsXButton1Pressed As bool
Value
bool bool bool

True if the button is pressed; otherwise false.

Attributes

Remarks

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

IsXButton2Pressed IsXButton2Pressed IsXButton2Pressed

Gets the pressed state of the second extended mouse button.

public PlatForm::Boolean IsXButton2Pressed { get; }public bool IsXButton2Pressed { get; }Public ReadOnly Property IsXButton2Pressed As bool
Value
bool bool bool

True if the button is pressed; otherwise false.

Attributes

Remarks

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

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 int
Value
int int int

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

Attributes

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

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 float
Value
float float float

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

Attributes

Remarks

Orientation is also referred to as azimuth.

PointerUpdateKind PointerUpdateKind PointerUpdateKind

Gets the kind of pointer state change.

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

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 float
Value
float float float

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

Attributes

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

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

public PlatForm::Boolean TouchConfidence { get; }public bool TouchConfidence { get; }Public ReadOnly Property TouchConfidence As bool
Value
bool bool bool

True if the touch contact was accepted; otherwise false.

Attributes

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

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 float
Value
float float float

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

Attributes

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 float
Value
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.

Attributes

Remarks

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

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 float
Value
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.

Attributes

Remarks

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

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>
Value

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

Attributes

Methods

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 int
Parameters
usagePage
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

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

The extended usage of the raw input pointer.

Attributes
See Also

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 PlatForm::Boolean HasUsage(UInt32 usagePage, UInt32 usageId)public bool HasUsage(UInt32 usagePage, UInt32 usageId)Public Function HasUsage(usagePage As UInt32, usageId As UInt32) As bool
Parameters
usagePage
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

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

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

Attributes

Remarks

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

Use HasUsage 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 PointerPointProperties. PropertyUsage PageUsage Position (X) 0x010x30 Position (Y) 0x010x31 RawPosition (X) 0x010x30 RawPosition (Y) 0x010x31 IsInContact 0x0D0x42 (tip) or 0x45 (eraser tip) Pressure 0x0D0x30 IsInverted 0x0D0x3C IsEraser 0x0D0x45 Orientation 0x0D0x3F XTilt 0x0D0x3D YTilt 0x0D0x3E Twist 0x0D0x41 ContactRect (Width) 0x0D0x48 ContactRect (Height) 0x0D0x49 ContactRectRaw (Width) 0x0D0x48 ContactRectRaw (Height) 0x0D0x49 TouchConfidence 0x0D0x47 IsInRange 0x0D0x32

See Also

See Also