robiot / xclicker

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

Start hotkey held until key repeat causes bad timing #16

Closed ericrkjones closed 2 years ago

ericrkjones commented 2 years ago

ISSUE TYPE:

OS / ENVIRONMENT:

STEPS TO REPRODUCE:

  1. Keyboard key repeat must be enabled
  2. Set click interval to a long time, like 1000ms (this is just to make the problem easier to observe)
  3. Hold down the start/stop hotkey until key repeat causes the Start and Stop buttons to rapidly toggle back and forth
  4. Release the start/stop hotkey

EXPECTED BEHAVIOUR:

I expected the start/stop hotkey to activate the clicker on release, not on press, and for the clicker to output clicks with period matching the Click Interval.

ACTUAL BEHAVIOUR:

The click output is of varying frequency. It still stops when the start/stop button is pressed.

Additional information (optional):

I stumbled on this because it makes intuitive sense to me for the autoclicker to fire while the hotkey is held down, like a gamepad with autofire, essentially starting when the button is pressed and stopping when it is released. I think that would be a very cool enhancement, and it would probably also make this issue go away. I expect that is probably a big tear-up, though.

robiot commented 2 years ago

Yeah, there should be a delay between capturing keys, or grabbing them on release instead. Holding down the hotkey and pressing the start/stop buttons at the same time will sometimes also cause a segmentation fault.

That hold down hotkey thing is great. I think another issue mentioned something like that, and I like the idea. I could somehow implement it. Tho often autoclickers are used for afk stuff, so the current hotkey functionality is useful for that. Ex. Choosing a position on screen, starting the autoclicker, then grabbing some coffe or whatever and then turn it of with the hotkey when you come back. Changing the functionality of the hotkey would affect the people that use it that way.