信息
您所需的主题如下所示。但此主题未包含在此库中。
此主题尚未评级 - 评价此主题

PointerDevice Class

支持识别连接的指针设备和确定其功能的能力。

语法


public ref class PointerDevice sealed 

特性

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

成员

PointerDevice类 具有这些类型的成员:

方法

The PointerDevice 类 具有这些方法。 对于 C#、Visual Basic 和 C++,它还继承方法于Object 类.

方法说明
GetPointerDevice Gets information about the pointer device associated with the specified input pointer ID.
GetPointerDevices Gets information about the pointer devices attached to the system.

 

属性

PointerDevice类 具有这些属性。

属性访问类型说明

IsIntegrated

只读Gets a value indicating whether the pointer device is an integrated device. For example, a video display with an integrated touch digitizer compared to an external pen/stylus digitizer.

MaxContacts

只读Gets a value indicating the maximum number of contacts supported by the input device.

PhysicalDeviceRect

只读Gets the coordinates of the bounding rectangle supported by the input device.

PointerDeviceType

只读Gets the pointer device type.

ScreenRect

只读Gets the screen coordinates that are mapped to the bounding rectangle supported by the input device.

SupportedUsages

只读Gets a collection containing the supported pointer device usages.

 

备注

由此处讨论的属性所返回的值基于连接的指针设备的总数:如果一个设备支持一个特定功能,那么布尔属性返回 true,数字属性返回所有设备显示的最大值,。

设备功能示例 演示如何检测输入设备存在并检索每个设备的功能和属性。

注意  :此类不敏捷,这意味着您需要考虑其线程模型和封送行为。有关更多信息,请参见线程处理和封送处理 (C++/CX)在多线程环境中使用 Windows 运行时对象 (.NET)

Windows Phone 8

此 API 不实现,但是调用时会引发异常。请参见 Windows Phone 运行时 API

示例

下面的代码演示如何使用 PointerDevice


function getPointerDevicesAndAttributes() {
    var pointerDevices = Windows.Devices.Input.PointerDevice.GetPointerDevices();
    var htmlWrite = "";
    for (i = 0; i < pointerDevices.Size; i++)  {
         htmlWrite += "<tr><td>(" + i + ") Pointer Device Type</td><td>";
         htmlWrite += getPointerDeviceType(pointerDevices[i].PointerDeviceType) + "</td></tr>";
         htmlWrite += "<tr><td>(" + i + ") Is External</td><td>" + pointerDevices[i].IsExternal + "</td></tr>";
         htmlWrite += "<tr><td>(" + i + ") Max Contacts</td><td>" + pointerDevices[i].MaxContacts + "</td></tr>";
         htmlWrite += "<tr><td>(" + i + ") Physical Device Rect</td><td>" +
             pointerDevices[i].PhysicalDeviceRect.X + "," +
             pointerDevices[i].PhysicalDeviceRect.Y + "," +
             pointerDevices[i].PhysicalDeviceRect.Width + "," +
             pointerDevices[i].PhysicalDeviceRect.Height + "</td></tr>";
         htmlWrite += "<tr><td>(" + i + ") Screen Rect</td><td>" +
             pointerDevices[i].ScreenRect.X + "," +
             pointerDevices[i].ScreenRect.Y + "," +
             pointerDevices[i].ScreenRect.Width + "," +
             pointerDevices[i].ScreenRect.Height + "</td></tr>";
    }
    id("pointerDevices").innerHTML = htmlWrite;
}

要求

最低支持客户端

Windows 8 [仅 Windows 应用商店应用程序]

最低支持服务器

Windows Server 2012 [仅 Windows 应用商店应用程序]

最低支持电话

Windows Phone 8 [未实现,请参见备注]

命名空间

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

元数据

Windows.winmd

另请参见

Windows.Devices.Input
快速入门
快速入门:识别输入设备

 

 

本文是否对您有所帮助?
(1500 个剩余字符)
感谢您的反馈
显示:
© 2014 Microsoft. 版权所有。