PointerPointProperties 類別

定義

提供 PointerPoint 物件的擴充屬性。

在大部分情況下,建議您透過所選 Windows 8 語言架構的指標事件處理程式取得指標資訊, (使用 JavaScript、使用 C++、C# 或 Visual Basic 的 UWP 應用程式,或使用 DirectX 搭配 C++) 的 UWP 應用程式。

如果事件自變數未公開應用程式所需的指標詳細數據,您可以透過 getCurrentPointgetIntermediatePoints 方法或 currentPointintermediatePoints 屬性,從事件自變數存取擴充指標數據。 建議您使用 getCurrentPointgetIntermediatePoints 方法,因為您可以指定指標數據的內容。

靜態 PointerPoint 方法 GetCurrentPointGetIntermediatePoints 一律使用應用程式的內容。

public ref class PointerPointProperties sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
class PointerPointProperties final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
public sealed class PointerPointProperties
Public NotInheritable Class PointerPointProperties
繼承
Object Platform::Object IInspectable PointerPointProperties
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

在下列範例中,我們會使用 PointerPoint 對象查詢各種擴充指標屬性。

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

備註

PointerPointProperties 類別會實作 IPointerPointProperties。

注意

這個類別不是敏捷的,這表示您必須考慮其線程模型和封送處理行為。 如需詳細資訊,請參閱線程和封送處理 (C++/CX) 在多線程環境中使用 Windows 執行階段 物件 (.NET)

Microsoft 互動式輸入設備架構的核心是以通用序列總線 (USB) 人類介面裝置的標準裝置類別定義 (HID) 為基礎,由 Implementers Forum, Inc. 定義。

通用序列總線 (USB) Human Interface Device (HID) 標準會定義 Human Interface Device (HID) 的設定和通訊協定,例如鍵盤、滑鼠裝置、遊戲桿和虛擬實境裝置,人類會用來直接將數據輸入計算機。 (如需 USB HID 標準的詳細資訊,請參閱 USB 實作者論壇 網站。)

雖然 Windows 輸入架構的核心是以通用序列總線 (USB) Human Interface Device (HID) 標準為基礎,但架構不限於通用序列總線 (USB) 裝置。 輸入架構也支援序列埠裝置、i8042 埠裝置和專屬輸入設備。

屬性

ContactRect

取得聯繫人區域的周框 (通常是從觸控輸入) 。

ContactRectRaw

取得原始輸入 (的周框,通常是從觸控輸入) 。

IsBarrelButtonPressed

取得值,這個值表示是否按下手寫筆/手寫筆裝置的滾筒按鈕。

IsCanceled

取得值,這個值表示指標裝置是否已取消輸入。

IsEraser

取得值,這個值表示輸入是否來自畫筆橡皮擦。

IsHorizontalMouseWheel

取得值,這個值表示輸入是否來自滑鼠傾斜滾輪。

IsInRange

取得值,指出指標裝置是否在感測器或數位板的偵測範圍內, (指標繼續存在) 。

IsInverted

取得值,這個值表示數位板畫筆是否反轉。

IsLeftButtonPressed

取得值,這個值表示指標輸入是否由輸入設備的主要動作模式觸發。

IsMiddleButtonPressed

取得值,這個值表示指標輸入是否由輸入裝置的第三個動作模式觸發。

IsPrimary

取得值,這個值表示當註冊多個指標時,輸入是否來自主要指標。

IsRightButtonPressed

取得值,這個值表示是否由次要動作模式觸發指標輸入, (是否支援輸入裝置的) 。

IsXButton1Pressed

取得值,指出指標輸入是否由第一個擴充滑鼠按鈕觸發, (XButton1) 。

IsXButton2Pressed

取得值,這個值表示指標輸入是否由第二個擴充滑鼠按鈕觸發, (XButton2) 。

MouseWheelDelta

取得值 (裝置所報告的原始值) ,指出從最後一個指標事件變更滾輪按鈕輸入。

Orientation

取得繞著指標裝置主要軸旋轉的逆時針角度, (z 軸,垂直於數位板表面) 。 值為 0.0 度表示裝置導向數位板頂端。

PointerUpdateKind

取得指標狀態變更的種類。

Pressure

取得值,這個值表示指標裝置 (通常是手寫筆/手寫筆,) 數位板介面上的手寫筆/手寫筆。

TouchConfidence

取得值,這個值表示指標裝置是否拒絕觸控接觸。

Twist

取得畫筆裝置繞著自己的主軸的順時針旋轉角度 (,例如當使用者在手指) 旋轉手寫筆時。

XTilt

取得 Y-Z 平面與平面之間的平面角度,其中包含 Y 軸和輸入設備座標軸 (通常是畫筆/手寫筆) 。

YTilt

取得 X-Z 平面與包含 X 軸的平面與輸入設備座標軸之間的平面角度, (通常是畫筆/手寫筆) 。

ZDistance

取得與裝置無關圖元之指標的 z 座標 (或距離) 。

方法

GetUsageValue(UInt32, UInt32)

取得原始輸入的 Human Interface Device (HID) 使用量值。

HasUsage(UInt32, UInt32)

取得值,指出指標裝置中的輸入數據是否包含指定的 Human Interface Device (HID) 使用資訊。

適用於

另請參閱