What Is AutoKey and What Does It Do for You?
Updated
AutoKey is a desktop automation utility for Linux and X11 that watches what you type and what hotkeys you press, then responds by expanding abbreviations or running scripts. You would use it when you retype the same phrases, addresses, or command sequences and want a short trigger to produce the full result. The official documentation at autokey.github.io covers version 0.96.0 and is the reference for the behavior described here.
The two mechanisms behind everything
AutoKey's feature set reduces to two triggers and two responses:
- Text trigger (abbreviation): you type a short string, and AutoKey replaces it with a longer phrase or runs a script.
- Hotkey trigger: you press a key combination, and AutoKey runs a script or inserts text.
The responses are either plain text expansion or a Python script that can call AutoKey's APIs. That is the whole model, and the documentation is organized around it: an introduction, a glossary of terms, common actions, and then the API reference.
What the APIs let a script do
The API reference is the clearest statement of AutoKey's scope. The documented modules are:
| API area | What it controls |
|---|---|
| Keyboard | Sending key presses and releases, typing strings, waiting for key events, and choosing a send mode |
| Mouse | Clicking (absolute, relative, relative to the script's own window), moving the cursor, pressing and releasing buttons, scrolling, selecting an area, waiting for a click |
| Store | Saving and reading values, including global values, and checking or removing stored keys |
| QtDialog | Opening dialogs such as a calendar or a chooser |
Two details are worth knowing before you plan anything:
- Send modes matter.
Keyboard.SendModeincludesKEYBOARD,CB_CTRL_V,CB_CTRL_SHIFT_V,CB_SHIFT_INSERT, andSELECTION. These are different ways of delivering text, and which one works depends on the target application. If expansion lands in the wrong place or does nothing, the send mode is the first thing to change. - Keys are named constants. The
Keyclass enumerates everything fromKey.LEFTandKey.ENTERthroughKey.F1–Key.F35, modifier keys likeKey.CONTROLandKey.SUPER, and numpad keys likeKey.NP_5. Scripts refer to these names rather than raw codes.
Concrete things you can automate
Using only documented capabilities, a typical setup looks like this:
- Phrase expansion. Type a short abbreviation and get a full signature block, a canned reply, or a shell command. The documentation's "Common actions" section starts with adding abbreviations, which is the entry point most users need.
- Hotkey-driven scripts. Bind a combination and have it type a string, press a sequence of keys, or click at a stored location.
- Form and field filling. Combine
Keyboard.send_keys()withKey.TABpresses to move between fields. - Mouse-position work. Use
Mouse.get_location()to capture a position andMouse.click_absolute()to return to it later. - Small stateful helpers. Use the Store API to keep a value between runs, for example a counter or a last-used path.
Where the documentation helps and where it stops
The site is an API and concepts reference, not a tutorial series. It explains terms, how things are organized, and how to "source" your settings onto a new computer — useful if you are moving a working configuration to a second machine. It does not describe installation, and the page evidence contains no pricing or licensing information, so treat availability and cost as things to confirm on the project itself rather than assume.
If you are deciding whether AutoKey fits: it does if you are on Linux with X11 and your repetitive work is typing, key presses, and mouse clicks. It does not if you need automation outside that environment, since the documented scope is desktop input on X11.