AutoClicker

Personal project


My role
  • Solo macOS Developer
Team
  • Solo project
Tools
  • Swift
  • SwiftUI
  • macOS Accessibility APIs
  • Core Graphics
  • UserDefaults
  • Xcode
  • GitHub
Timeline

2026

Description

A native macOS utility for automating repeated mouse clicks at either the current cursor position or a fixed screen location. It supports configurable click speeds, left and right clicking, finite or unlimited runs, global keyboard shortcuts, multiple displays, menu-bar controls, persistent settings, and macOS Accessibility integration.

Context

I built AutoClicker as a small native macOS automation utility rather than relying on an existing third-party tool. The project gave me an opportunity to work directly with macOS system APIs and build something that behaves like a proper desktop application rather than a web interface packaged for desktop use. Although the concept is simple, implementing reliable system-wide clicking required handling permissions, global input, multiple displays, application lifecycle events, persistent configuration, high-frequency timers, and failure states that do not normally appear in standard web development.

Click around...

Challenge

The visible feature—repeatedly clicking the mouse—is straightforward. The difficult part is making that feature behave predictably within macOS.

The application needed to post genuine system mouse events, support both cursor-relative and fixed-position clicking, detect permission changes, provide global start and stop controls, persist settings between launches, and stop safely when the environment becomes invalid.

Fixed-position clicking also had to remain usable across multiple monitors instead of assuming a single-screen coordinate system.

Constraints

macOS requires Accessibility permission before an application can generate system-level input events. This meant permission handling could not be treated as a one-time setup step; the application needed to communicate permission state clearly and respond if access disappeared.

Very high click rates introduce another limitation. Even when the application requests intervals approaching one millisecond, macOS and target applications may throttle, coalesce, or discard events.

The application also needed to handle machine sleep, screen locking, logout, changed display configurations, and invalid stored coordinates without continuing to emit unintended clicks.

Research

I worked through the relevant macOS input and Accessibility APIs to understand how synthetic mouse events are generated and how system permissions affect them.

I also explored how global shortcuts, screen coordinates, menu-bar utilities, application lifecycle notifications, and persisted settings are typically handled in native macOS applications.

A major part of the work involved understanding the difference between what the application can request and what the operating system can realistically guarantee, particularly at extremely high click frequencies.

Iterations

The utility expanded from basic repeated clicking into a more complete native application.

I added separate current-pointer and fixed-position modes, configurable mouse buttons, millisecond intervals, clicks-per-second input, finite run limits, and a configurable global shortcut.

Fixed-position selection was extended to work across multiple displays, while menu-bar controls made it possible to operate the utility without keeping the main window open.

I also added defensive stop conditions for sleep, lock, logout, Accessibility permission loss, and invalid display coordinates.

Settings were persisted through UserDefaults so the application could restore the user's previous configuration between sessions.

Key Features

  • Native SwiftUI macOS interface
  • Current-cursor clicking
  • Fixed-position clicking
  • Multi-display position picker
  • Left and right mouse button support
  • Click intervals from 1 ms to 60,000 ms
  • Up to 1,000 requested clicks per second
  • Unlimited clicking or fixed run counts up to 9,999,999
  • Configurable global start/stop shortcut
  • Menu-bar controls
  • Persistent settings using UserDefaults
  • macOS Accessibility permission handling
  • Automatic stopping when the Mac sleeps, locks, logs out, loses permission, or encounters invalid stored coordinates
  • Local .app build for direct use
  • Automated Xcode test support

Final Deliverable

The result is a standalone native macOS application capable of system-wide click automation without requiring a browser, scripting environment, or external runtime.

It includes the controls expected from a dedicated autoclicker while also accounting for macOS-specific concerns such as Accessibility permissions, application security identity, multi-monitor coordinates, and lifecycle changes.

Takeaway

AutoClicker gave me experience working much closer to the operating system than most of my web projects.

It reinforced that desktop utilities have a different class of edge cases: permissions can change outside the application, displays can disappear, sessions can lock, operating systems can throttle events, and stored state can become invalid because the surrounding hardware changed.

Building defensively around those conditions was more important than the core clicking algorithm itself.