PointerDevice
PointerDevice
PointerDevice
PointerDevice
PointerDevice
Class
Definition
Supports the ability to identify the connected pointer devices and determine their capabilities.
public : sealed class PointerDevice : IPointerDevice, IPointerDevice2
struct winrt::Windows::Devices::Input::PointerDevice : IPointerDevice, IPointerDevice2
public sealed class PointerDevice : IPointerDevice, IPointerDevice2
Public NotInheritable Class PointerDevice Implements IPointerDevice, IPointerDevice2
// This class does not provide a public constructor.
- Attributes
Device family |
Windows 10 (introduced v10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Examples
The following code shows how to use 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;
}
Remarks
The values returned by the properties discussed here are based on the total number of pointer devices connected: Boolean properties return true if one device supports a specific capability and numeric properties return the maximum value exposed by all devices.
The Device Capabilities Sample demonstrates how to detect the presence of input devices and retrieve the capabilities and attributes of each device.
Note
: This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).
Properties
IsIntegrated IsIntegrated IsIntegrated IsIntegrated 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 MaxContacts MaxContacts MaxContacts MaxContacts |
Gets a value indicating the maximum number of contacts supported by the input device. |
MaxPointersWithZDistance MaxPointersWithZDistance MaxPointersWithZDistance MaxPointersWithZDistance MaxPointersWithZDistance |
Gets the maximum number of hover contacts supported by the input device. |
PhysicalDeviceRect PhysicalDeviceRect PhysicalDeviceRect PhysicalDeviceRect PhysicalDeviceRect |
Gets the coordinates of the bounding rectangle supported by the input device. |
PointerDeviceType PointerDeviceType PointerDeviceType PointerDeviceType PointerDeviceType |
Gets the pointer device type. |
ScreenRect ScreenRect ScreenRect ScreenRect ScreenRect |
Gets the screen coordinates that are mapped to the bounding rectangle supported by the input device. |
SupportedUsages SupportedUsages SupportedUsages SupportedUsages SupportedUsages |
Gets a collection containing the supported pointer device usages. |
Methods
GetPointerDevice(UInt32) GetPointerDevice(UInt32) GetPointerDevice(UInt32) GetPointerDevice(UInt32) GetPointerDevice(UInt32) |
Gets information about the pointer device associated with the specified input pointer ID. |
GetPointerDevices() GetPointerDevices() GetPointerDevices() GetPointerDevices() GetPointerDevices() |
Gets information about the pointer devices attached to the system. |