PointerDevice PointerDevice PointerDevice PointerDevice Class

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

Syntax

Declaration

public sealed class PointerDevicepublic sealed class PointerDevicePublic NotInheritable Class PointerDevice

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 summary

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.

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

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

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

Gets the pointer device type.

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

Gets a collection containing the supported PointerDeviceUsage.

Methods summary

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

Gets information about the pointer devices attached to the system.

Properties

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

    public bool IsIntegrated { get; }public bool IsIntegrated { get; }Public ReadOnly Property IsIntegrated As bool

    Property Value

    • bool
      bool
      bool
      bool

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

  • MaxContacts
    MaxContacts
    MaxContacts
    MaxContacts

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

    public uint MaxContacts { get; }public uint MaxContacts { get; }Public ReadOnly Property MaxContacts As uint

    Property Value

    • uint
      uint
      uint
      uint

      The number of contacts.

    Remarks

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

  • MaxPointersWithZDistance
    MaxPointersWithZDistance
    MaxPointersWithZDistance
    MaxPointersWithZDistance

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

    public uint MaxPointersWithZDistance { get; }public uint MaxPointersWithZDistance { get; }Public ReadOnly Property MaxPointersWithZDistance As uint

    Property Value

  • PhysicalDeviceRect
    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

    Property Value

  • PointerDeviceType
    PointerDeviceType
    PointerDeviceType
    PointerDeviceType

    Gets the pointer device type.

    public PointerDeviceType PointerDeviceType { get; }public PointerDeviceType PointerDeviceType { get; }Public ReadOnly Property PointerDeviceType As PointerDeviceType

    Property Value

  • ScreenRect
    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

    Property Value

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

  • SupportedUsages
    SupportedUsages
    SupportedUsages
    SupportedUsages

    Gets a collection containing the supported PointerDeviceUsage.

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

    Property Value

    • A collection containing the supported pointer device usages.

    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.

Methods

  • GetPointerDevice(System.UInt32)
    GetPointerDevice(System.UInt32)
    GetPointerDevice(System.UInt32)
    GetPointerDevice(System.UInt32)

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

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

    Parameters

    • pointerId
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The ID of the pointer input.

    Returns

    Remarks

    GetPointerDevice(System.UInt32) is a static method.

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

  • GetPointerDevices()
    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.

    Remarks

    GetPointerDevices() is a static method.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MuseAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Devices.Input.dll