-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMouseInputSource.cs
More file actions
39 lines (31 loc) · 1.08 KB
/
MouseInputSource.cs
File metadata and controls
39 lines (31 loc) · 1.08 KB
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
using System;
namespace Com.GitHub.ZachDeibert.GraphicsCore {
public sealed class MouseInputSource {
public event MoveHandler Scroll;
public event MoveHandler Move;
public event Action Enter;
public event Action Leave;
public event ClickHandler Click;
public event ClickHandler Release;
internal void OnScroll(double x, double y) {
Scroll?.Invoke(x, y);
}
internal void OnMove(double x, double y) {
Move?.Invoke(x, y);
}
internal void OnEnter() {
Enter?.Invoke();
}
internal void OnLeave() {
Leave?.Invoke();
}
internal void OnClick(MouseButton button, KeyModifiers modifiers) {
Click?.Invoke(button, modifiers);
}
internal void OnRelease(MouseButton button, KeyModifiers modifiers) {
Release?.Invoke(button, modifiers);
}
public delegate void MoveHandler(double x, double y);
public delegate void ClickHandler(MouseButton button, KeyModifiers modifiers);
}
}