So this is my code.This should send infinite lines with word "test" while I am holding Middle Mouse.But when I press Middle mouse for 1 second it just goes on and not stops.
I just use std::cout << "test" to test if my code works.What I really want to do with program is: get infinite left mouse clicks while I hold middle mouse
The code's a bit messy with globals, magic numbers, ... I can see what you're trying to do, but ...
BTW, that's not how you do threading, you should have some controlled means of synchronising thread shutdowns. Stopping execution of code like that goes against C++ principles.