A small, dependency-free Rust autoclicker that clicks after the mouse moves and then stops.
The main use case is dwell clicking: move the pointer to a target, stop moving, and let the app click for you after a configurable delay.
- Clicks only after pointer movement has been observed.
- Waits for the pointer to remain still for a configurable idle delay.
- Clicks once per movement-stop cycle, then waits for movement again.
- Cancels a pending click when keyboard activity is detected, so hotkeys keep working.
- Supports left, middle, and right click.
- Reads configuration from
~/.autoclick. - Installs a background runner for Linux, macOS, and Windows.
- Uses native OS APIs directly; no Rust crate dependencies.
| Platform | Backend | Notes |
|---|---|---|
| Linux | /dev/input/event* + /dev/uinput |
Works below both X11 and Wayland. Requires root or equivalent device permissions. |
| macOS | CoreGraphics | Requires Accessibility permission. |
| Windows | User32 | Uses GetCursorPos and SendInput. |
Wayland does not provide a standard global pointer-position or synthetic-click API for normal applications. On Linux, autoclick therefore uses kernel input devices instead of display-server APIs:
- pointer motion is read from
/dev/input/event* - keyboard activity can be used as a guard filter to cancel pending clicks
- clicks are injected through
/dev/uinput - keyboard-only devices are ignored using evdev capability checks
This makes the Linux backend display-server-independent, so the same implementation is used for X11 and Wayland.
cargo build --releaseThe binary will be at:
target/release/autoclickautoclick reads ~/.autoclick by default. Create the default config with:
target/release/autoclick configDefault configuration:
# autoclick configuration
# The app clicks once after the pointer moves, then remains still for idle_ms.
enabled = true
idle_ms = 700
poll_ms = 50
keyboard_guard = true
button = left
max_clicks = unlimited
dry_run = falseConfig keys:
| Key | Values | Description |
|---|---|---|
enabled |
true, false |
Enables or disables the autoclick loop. |
idle_ms |
integer | How long the pointer must be still before clicking. |
poll_ms |
integer | How often to poll pointer movement. |
keyboard_guard |
true, false |
Cancels a pending click when keyboard activity is detected. |
button |
left, middle, right |
Mouse button to click. |
max_clicks |
integer, unlimited, none |
Optional limit before the process exits. |
dry_run |
true, false |
Log would-be clicks without injecting real clicks. |
repeat_ms is accepted for compatibility with older config files, but current behavior is intentionally one click per stop.
To use a different config path:
AUTOCLICK_CONFIG=/path/to/config autoclick runLinux requires elevated input-device access:
sudo target/release/autoclick runmacOS and Windows can run as the current user:
target/release/autoclick runOn macOS, grant the executable Accessibility permission in System Settings.
Build the release binary first:
cargo build --releaseLinux:
sudo target/release/autoclick install
sudo target/release/autoclick uninstallThe Linux installer creates:
/etc/systemd/system/autoclick.service
When installed with sudo, the service stores AUTOCLICK_CONFIG in the unit so the root-running service still reads the invoking user's ~/.autoclick.
macOS:
target/release/autoclick install
target/release/autoclick uninstallThe macOS installer creates:
~/Library/LaunchAgents/dev.autoclick.autoclick.plist
Windows:
autoclick.exe install
autoclick.exe uninstallThe Windows installer creates a Task Scheduler task named autoclick.
Autoclicking can interact with whatever is under the pointer. Test with:
dry_run = true
max_clicks = 1On Linux, the daemon runs with elevated privileges because it needs /dev/input/event* and /dev/uinput. Review the code and configuration before installing it as a service.
Format and check:
cargo fmt --check
cargo checkCross-target type checks used during development:
cargo check --target x86_64-pc-windows-gnu
cargo check --target x86_64-apple-darwinLicensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.