A cross-platform auto clicker with a Tkinter GUI, built entirely on the
Python 3 standard library. No pip install required — not for the
interface, and not for the mouse automation underneath it.
License: CC BY-ND 4.0 (Attribution-NoDerivatives) — see LICENSE.md. View it, run it, learn from it. Redistributing a modified version isn't permitted. Details in the License section below.
TkClicker automates left, middle, or right mouse clicks at an interval you control, either indefinitely or for a fixed number of repetitions. That's the whole feature set — this is a small, readable, single-purpose utility, not a macro engine or an automation framework. It's meant to be a clean example of a real desktop app built without any third-party dependencies.
The entire app is one small window with five controls and a status line.
| Control | What it does |
|---|---|
| Interval field + unit dropdown | How long to wait between clicks. Enter a number and choose milliseconds or seconds. |
| Button dropdown | Which mouse button to click: left, middle, or right. |
| Repeat field | How many clicks to perform. Enter 0 to click until you press Stop. |
| Start button | Begins clicking using the current settings. |
| Stop button | Stops clicking immediately, even mid-interval. |
| Quit button | Closes the app and shuts down the clicking thread cleanly. |
| Status line | Shows whether TkClicker is idle, clicking, stopped, finished, or reports a validation/backend error. |
| Click counter | A running total of clicks performed during the current run. |
These work while the TkClicker window is focused:
| Key | Action |
|---|---|
F6 |
Start clicking |
F7 |
Stop clicking |
Esc |
Stop clicking |
- Set Interval (for example,
500+milliseconds, or1+seconds). - Choose the Button to click.
- Set Repeat to
0for continuous clicking, or a specific count (e.g.50). - Click Start (or press
F6). - Click Stop (or press
F7/Esc) whenever you want to end a continuous run. A limited run stops itself and reports "Finished."
If the Interval or Repeat fields contain something invalid — text instead of a number, a negative value, zero for the interval — TkClicker will not start, and the status line explains what to fix.
TkClicker has no dependencies to install. Clone or download the repository, then run:
python3 autoclicker.pyPlatform notes:
- Windows: works out of the box. If clicks don't register in a specific application, try running the terminal as Administrator — some apps block synthetic input from lower-privilege processes (UIPI).
- macOS: the process running TkClicker (Terminal, or a packaged app) needs Accessibility permission under System Settings → Privacy & Security → Accessibility. macOS will prompt for this the first time TkClicker tries to click.
- Linux: requires an X11 session (or XWayland) and
libxtst6installed (sudo apt install libxtst6on Debian/Ubuntu). Pure Wayland sessions without XWayland are not supported, since the XTest extension TkClicker uses is X11-only.
Python version: 3.6 or newer, any CPython (or compatible) build.
autoclicker.py entry point: import header, version check, launch
tkclicker/
constants.py shared constants (app name, button IDs, version floor)
worker.py background clicking thread
gui.py Tkinter/ttk interface
backends/
__init__.py picks the right backend for the current OS
windows_backend.py Windows implementation
mac_backend.py macOS implementation
linux_backend.py Linux/X11 implementation
LICENSE.md
.gitignore
Standard library only, on purpose. Every import in this project ships
with a default Python 3 install: tkinter, threading, queue, ctypes,
time, sys. There is nothing to pip install, nothing that can go out
of date on PyPI, and nothing that requires a paid license to keep working
— which is the direct answer to the problem that started this project:
the original version depended on a GUI toolkit that later moved behind a
commercial license.
Why Tkinter. Tkinter ships with the standard CPython installer on Windows, macOS, and most Linux distributions, so it's the only GUI toolkit that meets the "zero dependencies" goal. It's not the flashiest toolkit available, but it's stable, well documented, and it means anyone can run this project immediately without a package manager.
Why one backend class per OS, in its own file. Each operating system synthesizes mouse input through a completely different native API:
| Platform | API | File |
|---|---|---|
| Windows | user32.SendInput |
tkclicker/backends/windows_backend.py |
| macOS | CoreGraphics / Quartz CGEventPost |
tkclicker/backends/mac_backend.py |
| Linux (X11) | libXtst XTestFakeButtonEvent |
tkclicker/backends/linux_backend.py |
Isolating each one in its own module keeps the ctypes bindings and
platform quirks from leaking into each other, and it means a bug or
missing library on one platform (say, libxtst6 not being installed on
Linux) can't affect the other two. A small factory in
tkclicker/backends/__init__.py checks sys.platform at startup and
hands the GUI whichever backend actually applies — the rest of the app
never has to know or care which OS it's running on.
Why a background thread instead of blocking the GUI. Tkinter's event
loop can't sit inside a time.sleep() without freezing the window (this
was, in fact, the bug that broke the original script). ClickWorker runs
on its own thread, parks on a threading.Event when idle, and uses an
interruptible, monotonic-clock-based sleep so Stop takes effect instantly
even on long intervals. It communicates back to the GUI thread through a
queue.Queue, since Tkinter widgets can only be touched safely from the
main thread.
TkClicker is licensed under Creative Commons
Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0), version 4.0
only — see LICENSE.md for the full legal text.
In plain terms: you're welcome to view the source, run the app, and use it as a reference for learning or evaluation — including in a professional, academic, or corporate review context. What this license does not permit is distributing a modified version of the code, or folding it into another project or codebase, without separate permission from the author. If you'd like to use TkClicker beyond what this license allows, reach out to discuss terms.