Pointer​Device Pointer​Device Pointer​Device Class

Definition

Supports the ability to identify the connected pointer devices and determine their capabilities.

public sealed class PointerDevice : IPointerDevice, IPointerDevice2public sealed class PointerDevice : IPointerDevice, IPointerDevice2Public NotInheritable Class PointerDevice Implements IPointerDevice, IPointerDevice2
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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).

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

Properties

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.

public PlatForm::Boolean IsIntegrated { get; }public bool IsIntegrated { get; }Public ReadOnly Property IsIntegrated As bool
Value
bool bool bool

True if the pointer device is integrated; otherwise, false.

Attributes
See Also

MaxContacts MaxContacts MaxContacts

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

public unsigned short MaxContacts { get; }public uint MaxContacts { get; }Public ReadOnly Property MaxContacts As uint
Value
uint uint uint

The number of contacts.

Attributes

Remarks

This property typically returns a value of 5 or more for touch devices and 1 for mouse and pen/stylus devices.

See Also

MaxPointersWithZDistance MaxPointersWithZDistance MaxPointersWithZDistance

Gets the maximum number of hover contacts supported by the input device.

public unsigned short MaxPointersWithZDistance { get; }public uint MaxPointersWithZDistance { get; }Public ReadOnly Property MaxPointersWithZDistance As uint
Value
uint uint uint

The default value is 0.

Note

MaxPointersWithZDistance might not be equal to MaxContacts.

Attributes

PhysicalDeviceRect PhysicalDeviceRect PhysicalDeviceRect

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

public Rect PhysicalDeviceRect { get; }public Rect PhysicalDeviceRect { get; }Public ReadOnly Property PhysicalDeviceRect As Rect
Value
Rect Rect Rect

The bounding rectangle at 96 dots per inch (dpi).

Attributes
See Also

PointerDeviceType PointerDeviceType PointerDeviceType

Gets the pointer device type.

public PointerDeviceType PointerDeviceType { get; }public PointerDeviceType PointerDeviceType { get; }Public ReadOnly Property PointerDeviceType As PointerDeviceType
Attributes
See Also

ScreenRect ScreenRect ScreenRect

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

public Rect ScreenRect { get; }public Rect ScreenRect { get; }Public ReadOnly Property ScreenRect As Rect
Value
Rect Rect Rect

The screen coordinates, in device-independent pixel (DIP).

Attributes
See Also

SupportedUsages SupportedUsages SupportedUsages

Gets a collection containing the supported pointer device usages.

public IVectorView<PointerDeviceUsage> SupportedUsages { get; }public IVectorView<PointerDeviceUsage> SupportedUsages { get; }Public ReadOnly Property SupportedUsages As IVectorView<PointerDeviceUsage>
Value

A collection containing the supported pointer device usages.

Attributes

Remarks

A Human Interface Device (HID) usage describes what a Human Interface Device (HID)-compliant control is measuring or reporting and can also indicate the control's intended use. A specific control usage is defined by its usage page, a usage ID, a name, and a description. For more info, see Device Class Definition for .

Note

The core of the Microsoft interactive input device architecture is based on the Universal Serial Bus (USB) standard Device Class Definition for Human Interface Device (HID), which is defined by the Implementers Forum, Inc.

The Universal Serial Bus (USB) Human Interface Device (HID) standard defines the configuration and communication protocols for Human Interface Device (HID), such as keyboards, mouse devices, joysticks, and virtual reality devices, that humans use to enter data directly into a computer. (For detailed information about the USB HID standard, see the USB Implementers Forum website.)

Although the core of the Windows input architecture is based on the Universal Serial Bus (USB) Human Interface Device (HID) standard, the architecture is not limited to Universal Serial Bus (USB) devices. The input architecture also supports serial port devices, i8042 port devices, and proprietary input devices.

See Also

Methods

GetPointerDevice(UInt32) GetPointerDevice(UInt32) GetPointerDevice(UInt32)

Gets information about the pointer device associated with the specified input pointer ID.

public static PointerDevice GetPointerDevice(UInt32 pointerId)public static PointerDevice GetPointerDevice(UInt32 pointerId)Public Static Function GetPointerDevice(pointerId As UInt32) As PointerDevice
Parameters
pointerId
System.UInt32 System.UInt32 System.UInt32

The ID of the pointer input.

Returns

The PointerDevice object that represents the associated pointer device.

Attributes

Remarks

GetPointerDevice is a static method.

The input pointer specified by pointerId must identify an active input.

See Also

GetPointerDevices() GetPointerDevices() GetPointerDevices()

Gets information about the pointer devices attached to the system.

public static IVectorView<PointerDevice> GetPointerDevices()public static IVectorView<PointerDevice> GetPointerDevices()Public Static Function GetPointerDevices() As IVectorView( Of PointerDevice )
Returns

The collection of PointerDevice objects that represent the pointer devices attached to the system.

Attributes

Remarks

GetPointerDevices is a static method.

See Also

See Also