PointerPointProperties, classe
TOC
Réduire la table des matières
Développer la table des matières

PointerPointProperties Class

Fournit des propriétés étendues pour un objet PointerPoint.

Remarque  Dans la plupart des cas, nous vous recommandons d'obtenir les informations de pointeur via les gestionnaires d'événements de pointeur de votre infrastructure de langage Windows 8 sélectionnée (applications Windows Store utilisant JavaScript, applications Windows Store pour Windows utilisant C++, C# ou Visual Basic, ou applications Windows Store pour Windows utilisant DirectX avec C++). Le PointerPoint associé au gestionnaire d'événements fournit des informations dans le contexte de l'élément d'interface cible, alors que les méthodes PointerPoint (GetCurrentPoint et GetIntermediatePoints) fournissent des informations dans le contexte de la fenêtre ou de l'écran parent.

Syntaxe


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

Attributs

MarshalingBehaviorAttribute(None)
VersionAttribute(NTDDI_WIN8)

Membres

PointerPointPropertiesClasse comporte les types de membres suivants :

Méthodes

The PointerPointProperties Classe comporte les méthodes suivantes. Avec C#, Visual Basic et C++, il hérite également des méthodes de Object Classe.

MéthodeDescription
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.

 

Propriétés

Le PointerPointPropertiesClasse contient les propriétés suivantes.

PropriétéType d’accèsDescription

ContactRect

en lecture seuleGets the bounding rectangle of the contact area (typically from touch input).

ContactRectRaw

en lecture seuleGets the bounding rectangle of the raw input (typically from touch input).

IsBarrelButtonPressed

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

IsCanceled

en lecture seuleGets a value that indicates whether the input was canceled by the pointer device.

IsEraser

en lecture seuleGets a value that indicates whether the input is from a digitizer eraser.

IsHorizontalMouseWheel

en lecture seuleGets a value that indicates whether the input is from a mouse tilt wheel.

IsInRange

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

IsInverted

en lecture seuleGets a value that indicates whether the digitizer pen is inverted.

IsLeftButtonPressed

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

IsMiddleButtonPressed

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

IsPrimary

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

IsRightButtonPressed

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

IsXButton1Pressed

en lecture seuleGets the pressed state of the first extended mouse button.

IsXButton2Pressed

en lecture seuleGets the pressed state of the second extended mouse button.

MouseWheelDelta

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

Orientation

en lecture seuleGets 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

en lecture seuleGets the kind of pointer state change.

Pressure

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

TouchConfidence

en lecture seuleGets a value that indicates whether the pointer device rejected the touch contact.

Twist

en lecture seuleGets 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

en lecture seuleGets 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

en lecture seuleGets 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).

 

Remarques

La classe PointerPointProperties implémente IPointerPointProperties.

Remarque   : cette classe n'est pas agile, ce qui signifie que vous devez prendre en compte son modèle de thread et son comportement de marshaling. Pour plus d'informations, consultez Threads et marshaling (C++/CX) et Utilisation d'objets Windows Runtime dans un environnement multithread (.NET).

Exemples

Dans l'exemple suivant, nous interrogeons plusieurs propriétés de pointeur étendues à l'aide d'un objet PointerPoint.


// 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 ptTargetProperties = e.getCurrentPoint(e.currentTarget).properties;

    var details = "Pointer Id: " + e.pointerId;
    switch (e.pointerType) {
        case e.MSPOINTER_TYPE_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 e.MSPOINTER_TYPE_PEN:
            details += "\nPointer type: pen";
            if (ptProperties.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 e.MSPOINTER_TYPE_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;
}


Configuration requise

Client minimal pris en charge

Windows 8 [Applications du Windows Store uniquement]

Serveur minimal pris en charge

Windows Server 2012 [Applications du Windows Store uniquement]

Téléphone minimal pris en charge

Windows Phone 8

Espace de noms

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

Métadonnées

Windows.winmd

Voir aussi

Classes Windows.UI.Input
Windows.UI.Input.PointerPoint.properties

 

 

Afficher:
© 2017 Microsoft