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

适用于