Share via


PointerDeviceType 列舉

定義

列舉指標裝置類型。

public enum class PointerDeviceType
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class PointerDeviceType
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum PointerDeviceType
var value = Windows.Devices.Input.PointerDeviceType.touch
Public Enum PointerDeviceType
繼承
PointerDeviceType
屬性

Windows 需求

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

欄位

Mouse 2

滑鼠

Pen 1

手寫筆

Touch 0

已啟用觸控功能的裝置

範例

下列範例示範如何使用 PointerDeviceType 列舉。

function getPointerDeviceType(pdt)
{
    switch(pdt)
    {
        case Windows.Devices.Input.PointerDeviceType.touch:
            return "Touch";

        case Windows.Devices.Input.PointerDeviceType.pen:
            return "Pen";

        case Windows.Devices.Input.PointerDeviceType.mouse:
            return "Mouse";
    }
    return "Undefined";
}

適用於