PointerPointProperties class
TOC
Collapse the table of content
Expand the table of content

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 apps using JavaScript, Windows Store apps using C++, C#, or Visual Basic, or Windows Store apps 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


var pointerPointProperties = Windows.UI.Input.PointerPoint.properties;

Members

The PointerPointProperties class has these types of members:

Methods

The PointerPointProperties class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

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

 

Properties

The PointerPointProperties class has these properties.

PropertyAccess typeDescription

ContactRect

Read-only

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

ContactRectRaw

Read-only

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

IsBarrelButtonPressed

Read-only

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

IsCanceled

Read-only

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

IsEraser

Read-only

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

IsHorizontalMouseWheel

Read-only

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

IsInRange

Read-only

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

IsInverted

Read-only

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

IsLeftButtonPressed

Read-only

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

IsMiddleButtonPressed

Read-only

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

IsPrimary

Read-only

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

IsRightButtonPressed

Read-only

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

IsXButton1Pressed

Read-only

Gets the pressed state of the first extended mouse button.

IsXButton2Pressed

Read-only

Gets the pressed state of the second extended mouse button.

MouseWheelDelta

Read-only

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

Orientation

Read-only

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

PointerUpdateKind

Read-only

Gets the kind of pointer state change.

Pressure

Read-only

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

TouchConfidence

Read-only

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

Twist

Read-only

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

XTilt

Read-only

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

YTilt

Read-only

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

 

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 Devices (HIDs), which is defined by the USB Implementers Forum, Inc.

The USB HID standard defines the configuration and communication protocols for HIDs, 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 USB HID standard, the architecture is not limited to 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;
}


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Input
Windows::UI::Input [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Windows.UI.Input
Windows::UI::Input [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(None)]
[Version(0x06020000)]

See also

Object
Reference
Windows.UI.Input Classes
Windows.UI.Input.PointerPoint.properties
Windows.Devices.Input
Windows.UI.Core
Windows.UI.Input
Windows.UI.Input.Inking
Windows.UI.Xaml.Input
TypedEventHandler
Conceptual
Custom user interactions
UX guidelines for custom user interactions
Touch design guidelines
Samples
User interaction mode sample
Focus visuals sample
Archive samples (Windows Store app APIs)
Input: Device capabilities sample
Input: Ink sample
Input: Manipulations and gestures (JavaScript) sample
Input: Simplified ink sample
Input: Windows 8 gestures sample
Input: XAML user input events sample
XAML scrolling, panning, and zooming sample
Archive samples (DirectX)
DirectX touch input sample
Input: Manipulations and gestures (C++) sample
Input: Touch hit testing sample
Archive samples (Win32/Desktop)
Input source identification sample
Touch injection sample
Win32 touch hit-testing sample

 

 

Show:
© 2017 Microsoft