MouseDeviceCounter ClassDelta Engine Documentation
Helper class to count the number of mouse devices connected to the computer. This makes it possible to check the availability of Mouse support. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Input.Windows MouseDeviceCounter

Namespace: DeltaEngine.Input.Windows
Assembly: DeltaEngine.Input.Windows (in DeltaEngine.Input.Windows.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class MouseDeviceCounter

The MouseDeviceCounter type exposes the following members.

Constructors

  NameDescription
Public methodMouseDeviceCounter
Initializes a new instance of the MouseDeviceCounter class
Top
Methods

  NameDescription
Public methodGetNumberOfAvailableMice
Top
Remarks

Tests: DeltaEngine.Input.Windows.Tests.MouseDeviceCounterTests
Examples

2 unit tests call DeltaEngine.Input.Windows.MouseDeviceCounter
[Test]
public void GetNumberOfAvailableMice()
{
    Assert.DoesNotThrow(delegate
    {
        var counter = new MouseDeviceCounter();
        Assert.Greater(counter.GetNumberOfAvailableMice(), 0);
    });
}
[Test]
public void DeviceCounterInMouseProperty()
{
    var windowsMouse = GetMouse();
    Assert.IsTrue(windowsMouse.IsAvailable);
}
See Also