Skip to content

Multi-monitor: picks on a left-side monitor click the wrong place; right-side monitors are rejected #40

Closed

Description

@TMHSDigital

Summary

The coordinate picker and the click engine use different coordinate spaces. Multi-monitor setups are effectively unsupported, and the failure is either silent or misleading.

Why it matters

Multiple monitors are common for the people who use autoclickers. Right now:

  • Monitor to the left of / above the primary: the picker returns negative coordinates (mouse.get_position()). Sanitization clamps them to 0 (see Validation silently rewrites bad input (e.g. interval -500 runs at max speed) #39), and the app clicks the left edge of the primary monitor.
  • Monitor to the right of / below the primary: validation rejects the pick with "outside screen bounds", because bounds come from pyautogui.size(), which is the primary monitor only.
  • The bounds check is also off by one: 0 <= x <= screen_width accepts x == width, which is off-screen.

Evidence

  • autoclicker/utils/coordinate_picker.py:99 — mouse.get_position() returns virtual-desktop coordinates.
  • autoclicker/app/controller.py:103, autoclicker/core/click_engine.py:146 and :449 — bounds from pyautogui.size().
  • autoclicker/core/settings_manager.py:89, click_engine.py:451 — inclusive upper bound.
  • sanitize_input clamps coordinates to 0..10000 (settings_manager.py:253, tracked in Validation silently rewrites bad input (e.g. interval -500 runs at max speed) #39).

Suggested approach

  • Get virtual-screen bounds from GetSystemMetrics(SM_XVIRTUALSCREEN / SM_YVIRTUALSCREEN / SM_CXVIRTUALSCREEN / SM_CYVIRTUALSCREEN) through pywin32 (already a dependency), and validate against [left, left+width) × [top, top+height).
  • Allow negative coordinates through parsing/validation.
  • Check that pyautogui's moveTo reaches negative/secondary coordinates on Windows. If it doesn't, move the cursor with SetCursorPos/SendInput directly.
  • Note that the PyAutoGUI failsafe corners refer to the primary monitor; document it or implement a virtual-desktop corner check.

Done when

  • Picking and clicking works on a secondary monitor on either side of the primary (manual test documented in the PR).
  • Bounds use a half-open range; unit tests cover negative and right-of-primary coordinates.

Activity

  1. added
    bug
    priority: high
    on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions