I'm basically creating an app that as long as you hold down the left click on your mouse, it will execute left clicks in a loop in a specific cooldown, the problem I'm facing is that when you hold down the left click its executing another clicks which makes the program think that you stopped to hold the button, so I'm searching for a way to send mouse_event function amd make my mouse hook ignore the mouse event function somehow
void mouse_OnMouseActivity(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (Utils.dont || !mode)
{
return;
}
if (mode && !Focused && e.Clicks == 1 && e.Button == MouseButtons.Left && !down && Threads.Count == 0 && !Utils.dont)
{
down = true;
Console.WriteLine("DOWN");
Thread th = new Thread(() => {
Workers++;
while (!Focused && down && mode)
{
Console.WriteLine(">> " + Threads.Count+ " | "+Utils.dont);
Console.Title = Workers.ToString();
Utils.Click();
System.Threading.Thread.Sleep(delay);
}
Workers--;
});
th.Start();
Threads.Add(th);
}
else
{
if (e.Clicks == 2 && e.Button == MouseButtons.Left && !Utils.dont)
{
down = false;
Console.WriteLine("UP " + (e.Button == MouseButtons.Left));
if (Threads.Count != 0)
{
Workers= 0;
List<Thread> ToRemove = new List<Thread>();
foreach (var thread in Threads)
{
ToRemove.Add(thread);
}
foreach(var thread in ToRemove)
{
Threads.Remove(thread);
}
}
}
}
}