MouseHookTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Input.Windows.Tests MouseHookTests

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

public class MouseHookTests

The MouseHookTests type exposes the following members.

Constructors

  NameDescription
Public methodMouseHookTests
Initializes a new instance of the MouseHookTests class
Top
Methods

  NameDescription
Public methodTestButtonQueue
Public methodTestGetMessageButton
Public methodTestIsPressed
Public methodTestIsReleased
Top
Examples

[Test]
public void TestIsPressed()
{
    Assert.True(MouseHook.IsPressed(0x0201));
    Assert.False(MouseHook.IsPressed(0));
}
[Test]
public void TestIsReleased()
{
    Assert.True(MouseHook.IsReleased(0x00A2));
    Assert.False(MouseHook.IsReleased(0));
}
[Test]
public void TestGetMessageButton()
{
    Assert.AreEqual(MouseButton.Left, MouseHook.GetMessageButton(0x00A2, 0));
    Assert.AreEqual(MouseButton.Right, MouseHook.GetMessageButton(0x0205, 0));
    Assert.AreEqual(MouseButton.Middle, MouseHook.GetMessageButton(0x0209, 0));
    Assert.AreEqual(MouseButton.X1, MouseHook.GetMessageButton(0x020B, 65536));
    Assert.AreEqual(MouseButton.X2, MouseHook.GetMessageButton(0x020B, 0));
}
[Test]
public void TestButtonQueue()
{
    var hook = new MouseHook();
    hook.ProcessButtonQueue(State.Released, MouseButton.Left);
}
See Also