-
Notifications
You must be signed in to change notification settings - Fork 0
/
MouseClickHandler.cs
36 lines (31 loc) · 1.03 KB
/
MouseClickHandler.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
using MouseKeyboardActivityMonitor;
using MouseKeyboardActivityMonitor.WinApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MHP3rdController
{
static class MouseClickHandler
{
private static MouseHookListener MouseHook;
public static void Run()
{
MouseHook = new MouseHookListener(new GlobalHooker());
MouseHook.MouseDownExt += MouseHook_MouseDownExt;
MouseHook.MouseUp += MouseHook_MouseUp;
MouseHook.Enabled = true;
}
private static void MouseHook_MouseDownExt(object sender, MouseEventExtArgs e)
{
if(e.Button == System.Windows.Forms.MouseButtons.Left)
Shooter.IsShooting = true;
}
private static void MouseHook_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
Shooter.IsShooting = false;
}
}
}