-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathMouseMoveEventArgs.cs
63 lines (55 loc) · 1.92 KB
/
MouseMoveEventArgs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Drawing;
namespace GLFW
{
/// <summary>
/// Arguments supplied with mouse movement events.
/// </summary>
/// <seealso cref="EventArgs" />
public class MouseMoveEventArgs : EventArgs
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="MouseMoveEventArgs" /> class.
/// </summary>
/// <param name="x">
/// The cursor x-coordinate, relative to the left edge of the client area, or the amount of movement on
/// x-axis if this is scroll event.
/// </param>
/// <param name="y">
/// The cursor y-coordinate, relative to the left edge of the client area, or the amount of movement on
/// y-axis if this is scroll event.
/// </param>
public MouseMoveEventArgs(double x, double y)
{
X = x;
Y = y;
}
#endregion
#region Properties
/// <summary>
/// Gets the position of the mouse, relative to the screen.
/// </summary>
/// <value>
/// The position.
/// </value>
public Point Position => new Point(Convert.ToInt32(X), Convert.ToInt32(Y));
/// <summary>
/// Gets the cursor x-coordinate, relative to the left edge of the client area, or the amount of movement on
/// x-axis if this is scroll event.
/// </summary>
/// <value>
/// The location on the x-axis.
/// </value>
public double X { get; }
/// <summary>
/// Gets the cursor y-coordinate, relative to the left edge of the client area, or the amount of movement on
/// y-axis if this is scroll event.
/// </summary>
/// <value>
/// The location on the y-axis.
/// </value>
public double Y { get; }
#endregion
}
}