Global hotkeys, a text expander and a macro recorder in Python that work in every app.

The complete version of our keyboard control tutorial: a text expander with smart triggers and placeholders, global hotkeys that type, paste, transform the selected text, open URLs or run programs, and a macro recorder that saves readable, editable steps. One JSON config, a live dashboard, a panic key, and nothing you type is ever stored.
Upgrades the free tutorial: How to Control your Keyboard in Python
Everything the tutorial leaves as an exercise, done properly.
Instant (;sig) or word (btw) triggers, case-aware, backspace-aware, with per-app snippets.
{date+7:%A}, {clipboard:url}, {cursor}, {input:Name}, counters, UUIDs...
UPPER, Title, snake_case, camelCase, kebab, slug, sort lines... in any app.
Record with a hotkey, replay at any speed; recordings become readable JSON steps.
Type, paste, key sequences with pauses, open URLs/files, run programs, chain macros.
Panic key, pause, conflict and OS-shortcut checks, and it never types into itself.
Only the last few characters are kept in memory; nothing typed is saved.
13 pytest tests drive the whole engine through a fake keyboard backend.
Real output of the tools. Sample data is used wherever a screenshot would show private information (networks, emails, processes).
The tutorial is great for learning the basics. This is the version you'd actually ship.
| Free tutorial | Keyboard Automation Pro | |
|---|---|---|
| Hotkeys | One example | Any number, from a config file |
| Text expansion | Basic abbreviations | Smart triggers, case, placeholders |
| Macros | Record/replay raw events | Readable, editable, speed and repeat |
| Text transforms | — | ✓ 15 transforms |
| Per-app rules | — | ✓ |
| Safety | — | Panic key, pause, validation |
| Dashboard + stats | — | ✓ |
| Tests | — | 13 pytest tests |
Clean, commented, modular Python. Here's the start of keyauto/expander.py:
def _match(self) -> Optional[Expansion]:
buf = self.buffer
for s in self.snippets:
if not self._active(s):
continue
if s.instant:
typed = buf[-len(s.trigger):]
if self._same(typed, s) and self._word_start(buf, len(s.trigger), s):
return Expansion(s, len(s.trigger), "", self._case(typed, s))
elif buf and buf[-1] in BOUNDARY:
word = buf[:-1][-len(s.trigger):]
if len(buf) > len(s.trigger) and self._same(word, s) and \
self._word_start(buf[:-1], len(s.trigger), s, required=True):
return Expansion(s, len(s.trigger) + 1, buf[-1], self._case(word, s))
The Python Tools Pro Pack includes Keyboard Automation Pro plus our other premium tools, for $21.75 instead of $65 when bought one by one.
What's in the pack?
Python 3.8 or newer. Windows and Linux use the keyboard package (on Linux run it as root or add yourself to the input group); macOS uses pynput and needs Accessibility permission for your terminal.
You're sent straight to your download page, and we email you the link too. The link keeps working, so you can re-download updated versions later. Lost it? Recover your downloads with your email.
If you've followed our free tutorial, yes. The code is split into small, commented modules, and the README walks through the architecture. It's the ideal next step after the tutorial.
Yes. You can modify it, learn from it, and ship your own tools and apps built on it, even commercially. The only thing you can't do is redistribute or resell the source code itself.
Email us within 14 days and we'll refund you. No questions asked.
$9 one-time. Instant download, free updates.
A live system dashboard in Python: terminal and web UIs, smart alerts, recordings and HTML reports
Scan, analyse and improve your Wi-Fi in Python: best channel, security checkup, site survey and reports
Transcripts and subtitles from any audio or video in Python, locally or with the OpenAI and Groq APIs
Search, back up, export and clean up any IMAP mailbox in Python, with Gmail-style queries and rules
All five premium Python games in one download: Tetromino, Flappy Wings, Chess, Snake and Platformer Pro