Alright, before you say just use mouse_event, just hear me out, please. I am making an autoclicker that only clicks when you hold left click down. I tried this with mouse_event, and it put it in a loop for an obvious reason, so I used mouse messages. There is a problem that I've found though that keeps it from successfully clicking on some applications. Thought someone could tell me how to solve it. I will link the log of the messages going to the application and explain the problem.
Here is my code: https://pastebin.com/2xXDQc6f
https://ibb.co/dLOKz7
^^^
As you see right there, that is clicking with the messages from the autoclicker. That is not the same as a real click. A real click sends a WM_INPUT which I tried, but don't quite understand it, i'm trying still. https://ibb.co/eUOf6n
^^^
This is a normal click. Notice how after each mouse_event it has a WM_INPUT to verify that it is real. My messages don't send this to the game, so it doesn't respond to the clicks. Again this is only for some applications. I would love to figure out this problem though.
Wow I just looked up the code for a tool called FastClicker, and it manages to do it with 500 lines of code, while using win api.
If you want to use the fast clicker to make the left mouse button repeat, you can do it by setting the trigger and key to press to be the "1" by clicking the box twice. (note do the key to press first)