robiot / xclicker

XClicker - Fast gui autoclicker for x11 linux desktops
https://xclicker.xyz
GNU General Public License v3.0
480 stars 42 forks source link

Add the 'hold' feature as requested by #18 #22

Closed ctxnop closed 2 years ago

ctxnop commented 2 years ago

Select the 'Hold' value in the 'Click type'. It disable widgets that make no sense in such situation. Emits the 'mouse down' event on start, and 'mouse up' on stop.

Signed-off-by: ctxnop ctxnop@gmail.com

robiot commented 2 years ago

I can fix these since I'm kinda bored atm

ctxnop commented 2 years ago

I fixed it. Let me know if you see any other issue I can solve.

robiot commented 2 years ago

LGTM. Will check again tomorrow and hopefully merge. It would be good if there is any good way of running the press down event once and then skip the loop so it doesn't have to try to run it multiple times per second. But I can't really think of a way that is clean. So lets keep it like this for now :)

ctxnop commented 2 years ago

Yeah, I agree. I thought that the main thread could lock a mutex on start and release it on stop. So the "clicking" thread would lock the same mutex and be blocked until the main thread released it. But, to be honest, I added this feature because I needed it this afternoon for few hours only. So I didn't want to spend too much time on it. If you want me to implement something using locks, tell me, I'll propose you something soon.

robiot commented 2 years ago

Merging. Thank you very much. Have a great day/night :)