MouseCapabilities MouseCapabilities MouseCapabilities MouseCapabilities Class

Supports the ability to determine the capabilities of any connected mouse devices.

Syntax

Declaration

public sealed class MouseCapabilitiespublic sealed class MouseCapabilitiesPublic NotInheritable Class MouseCapabilitiespublic sealed class MouseCapabilities

Remarks

The values returned by the properties discussed here are based on the total number of mice connected: Boolean properties return true if one mouse supports a specific capability and numeric properties return the maximum value exposed by all mice.

The Device Capabilities Sample demonstrates how to detect the presence of input devices and retrieve the capabilities and attributes of each device.

Constructors summary

Initializes a new instance of the @Windows.Devices.Input.MouseCapabilities.#ctor class.

Properties summary

Gets a value indicating whether any of the mice connected to the computer have a scroll wheel that tilts left and right (usually for horizontal scrolling).

Gets a value that indicates whether a mouse device is detected.

Gets a value representing the number of buttons on the mouse. If multiple mice are present, it returns the number of buttons of the mouse which has maximum number of buttons.

Gets a value indicating whether any of the mice connected to the computer has swapped left and right buttons.

Gets a value indicating whether any of the mice connected to the computer have a scroll wheel that rolls up and down (usually for vertical scrolling).

Constructors

  • MouseCapabilities()
    MouseCapabilities()
    MouseCapabilities()
    MouseCapabilities()

    Initializes a new instance of the @Windows.Devices.Input.MouseCapabilities.#ctor class.

    public MouseCapabilities()public New()Public Sub New()public MouseCapabilities()

    Remarks

    Examples

    The following code shows how to create an instance of the @Windows.Devices.Input.MouseCapabilities.#ctor class.

    function getMouseCapabilities() {
      var mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
    }
    

Properties

  • HorizontalWheelPresent
    HorizontalWheelPresent
    HorizontalWheelPresent
    HorizontalWheelPresent

    Gets a value indicating whether any of the mice connected to the computer have a scroll wheel that tilts left and right (usually for horizontal scrolling).

    public int HorizontalWheelPresent { get; }public int HorizontalWheelPresent { get; }Public ReadOnly Property HorizontalWheelPresent As intpublic int HorizontalWheelPresent { get; }

    Property Value

    • int
      int
      int
      int

      The number of horizontal wheels detected. Typically 0 or 1.

    Remarks

    Examples

    The following code shows how to use this method.

        function getMouseCapabilities() {
            var mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            id("horizontalWheelPresent").innerHTML = mouseCapabilities.HorizontalWheelPresent;
        }
    
  • MousePresent
    MousePresent
    MousePresent
    MousePresent

    Gets a value that indicates whether a mouse device is detected.

    public int MousePresent { get; }public int MousePresent { get; }Public ReadOnly Property MousePresent As intpublic int MousePresent { get; }

    Property Value

    • int
      int
      int
      int

      The number of mouse devices detected. Typically 0 or 1.

    Remarks

    Examples

    The following code shows how to use this method.

        function getMouseCapabilities() {
            var mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            id("mousePresent").innerHTML = mouseCapabilities.MousePresent;
        }
    
  • NumberOfButtons
    NumberOfButtons
    NumberOfButtons
    NumberOfButtons

    Gets a value representing the number of buttons on the mouse. If multiple mice are present, it returns the number of buttons of the mouse which has maximum number of buttons.

    public uint NumberOfButtons { get; }public uint NumberOfButtons { get; }Public ReadOnly Property NumberOfButtons As uintpublic uint NumberOfButtons { get; }

    Property Value

    • uint
      uint
      uint
      uint

      A value representing the number of buttons on the mouse. If multiple mice are present, it returns the number of buttons of the mouse which has maximum number of buttons.

    Remarks

    Examples

    The following code shows how to use this method.

        function getMouseCapabilities() {
            var mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            id("numberOfButtons").innerHTML = mouseCapabilities.NumberOfButtons;
        }
    
  • SwapButtons
    SwapButtons
    SwapButtons
    SwapButtons

    Gets a value indicating whether any of the mice connected to the computer has swapped left and right buttons.

    public int SwapButtons { get; }public int SwapButtons { get; }Public ReadOnly Property SwapButtons As intpublic int SwapButtons { get; }

    Property Value

    • int
      int
      int
      int

      A value indicating whether any of the mice connected to the computer has swapped left and right buttons.

    Remarks

    Examples

    The following code shows how to use this method.

        function getMouseCapabilities() {
            var mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            id("swapButtons").innerHTML = mouseCapabilities.SwapButtons;
        }
    
  • VerticalWheelPresent
    VerticalWheelPresent
    VerticalWheelPresent
    VerticalWheelPresent

    Gets a value indicating whether any of the mice connected to the computer have a scroll wheel that rolls up and down (usually for vertical scrolling).

    public int VerticalWheelPresent { get; }public int VerticalWheelPresent { get; }Public ReadOnly Property VerticalWheelPresent As intpublic int VerticalWheelPresent { get; }

    Property Value

    • int
      int
      int
      int

      The number of vertical wheels detected. Typically 0 or 1.

    Remarks

    Examples

    The following code shows how to use this method.

        function getMouseCapabilities() {
            var mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            id("verticalWheelPresent").innerHTML = mouseCapabilities.VerticalWheelPresent;
        }
    

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Devices.Input.dll