Repository navigation
Description
Why it matters
In Fixed location mode the app promises to click at X/Y. In practice, after the first click, every later click lands wherever the mouse currently is. If the user nudges the mouse (to check something, or by bumping the desk), the clicks follow the cursor into other windows: the taskbar, a browser tab's close button, a "Delete" button. For an app pitched as "pixel-precise" with "safety on by default", clicking somewhere the user never picked is the most serious failure mode it can have. The corner failsafe only helps if the cursor reaches a corner of the primary monitor.
Evidence
autoclicker/core/click_engine.py:424-435:
# Instant move; skip if already at target (avoids moveTo overhead each click)
if self._last_click_xy != (x, y):
pyautogui.moveTo(x, y, duration=0)
self._last_click_xy = (x, y)
...
pyautogui.click(button=mouse_button, clicks=2 if click_type == "double" else 1)_last_click_xy records where we last moved the cursor, not where the cursor is. pyautogui.click() without x/y clicks at the current cursor position. After the first click _last_click_xy == (x, y) for the rest of the run, so the move is skipped and the click goes to the live cursor position. tests/test_click_engine.py:78-83 (test_skips_move_when_same_coordinates) locks this behavior in.
Suggested approach
Pick one behavior deliberately and document it:
- Option A (recommended): always click at the target. Pass the coordinates to the click call,
pyautogui.click(x, y, button=..., clicks=...), or compare againstGetCursorPos(cheap) and move only when the cursor is elsewhere. The original perf concern is small withPAUSE = 0; re-measure withscripts/profile_click_engine.pyand updatedocs/PERFORMANCE.md. - Option B: treat user mouse movement as a stop signal. If the cursor is not where we left it, stop with a clear reason ("Stopped: mouse moved"). Several popular autoclickers offer this as an option; it could be a checkbox in Advanced, in addition to Option A.
Done when
- In Fixed mode, moving the mouse mid-run never causes a click anywhere except the target (Option A), or ends the run with a clear status and one
sessions.logstop line (Option B). - The old test is replaced by one that simulates a cursor moved away (
pyautogui.positionreturning a different point) and asserts the chosen behavior. - README "Pick and click" and Safety sections describe it, and the fix is in the next release.
Activity
test: real-input integration tests on the Windows CI runner