![]() | Auto-TypePowerful feature that sends keypresses to other applications. |
KeePass features an "Auto-Type" functionality. This feature allows you to define a sequence of keypresses, which KeePass can automatically perform for you. The simulated keypresses can be sent to any other currently open window of your choice (browser windows, login dialogs, ...).
By default, the sent keystroke sequence is {USERNAME}{TAB}{PASSWORD}{ENTER}
,
i.e. it first types the user name of the selected entry, then presses the Tab
key,
then types the password of the entry and finally presses the Enter
key.
For TAN entries, the default sequence is {PASSWORD}
,
i.e. it just types the TAN into the target window, without pressing Enter
.
Auto-Type:
".
Your notes could look something like this:You can write any notes here. My e-mail I used to register: test@nowhere.com Auto-Type: {USERNAME}{TAB}{TAB}Some fixed string{TAB}{PASSWORD}{ENTER} Here you can continue with your notes if you wish...As you can see, the only important thing is that the auto-type sequence is prefixed using "
Auto-Type:
" and is one single line. An auto-type sequence cannot
be defined using two or more lines. If you define two auto-type sequences, the first one is used.
Additionally, you can create customized window/sequence associations, which override the default sequence. You can specify different keystroke sequences for different windows for each entry. For example, imagine a webpage, to which you want to login, that has multiple pages where one can login. These pages could all look a bit different (on one you could additionally need to check some checkbox -- like often seen in forums). Here creating customized window/sequence associations solves the problems: you simply specify different auto-type sequences for each windows (identified by their window titles).
Invoking Auto-Type:
There are three different methods to invoke auto-type:
All methods are explained in details below.
This method is the one that requires the least amount of configuration and is the simpler one, but it has the disadvantage that you need to select the entry in KeePass which you want to auto-type.
The method is simple: right-click on an entry of your currently opened database and click 'Perform Auto-Type' (or alternatively press the Ctrl-V shortcut for this command). The window that previously got the focus (i.e. the one in which you worked before switching to KeePass) will be brought to the foreground and KeePass auto-types into this window.
The sequence which is auto-typed depends on the window's title. If you didn't specify any custom window/sequence associations, the default sequence is sent. If you created associations, KeePass uses the sequence of the first matching association. If none of the associations match, the default sequence is used.
This is the more powerful method, but it also requires a little bit more work/knowledge, before it can be used.
KeePass registers a system-wide hot key for auto-type. The advantage of this hot key is that you don't need to switch to the KeePass window and select the entry. You simply press the hot key while having the target window open (i.e. the window which will receive the keypresses).
By default, the global hot key is Ctrl-Alt-A (i.e. hold the Control and Alt keys, press 'A' and release all keys). You can change this hot key in the options dialog (main menu - 'Tools' - 'Options', tab 'Setup'): here, click into the textbox below "Global Auto-Type Hot Key Combination" and press the hot key that you wish to use. If the hot key is usable, it will appear in the textbox.
When you press the hot key, KeePass will look at the title of the currently opened window and search the currently opened database for usable entries. If KeePass finds multiple entries that can be used, it displays a selection dialog. In order to decide if an entry is usable for the current window title, at least one of the following conditions must be fulfilled:
You probably thought of the second condition already, but the first one at least is new. By using entry titles as filters for window titles, the configuration amount for auto-type is almost zero: you only need to make sure that the entry title is contained in the window title of the window into which you want the entry to be auto-typed. Of course, this is not always possible (for example if a webpage has a very generic title like "Welcome"), in this case you need to use the custom window/sequence associations.
Custom window/sequence associations can be specified using the Notes field of entries.My e-mail I used to register: test@nowhere.com Auto-Type: {USERNAME}{TAB}{TAB}Some fixed string{TAB}{PASSWORD}{ENTER} Auto-Type-Window: PayPal - Welcome* Here you can continue with your notes if you wish...If you now have a window open that starts with "PayPal - Welcome" and press the global auto-type hot key combination, KeePass performs the auto-type sequence above.
Auto-Type-Window
strings to automate these sites.
You can also use Auto-Type-Window
strings to standardize your LAN login
in one KeePass entry.Auto-Type-Window
strings per entry can be defined as you wish.Auto-Type: {USERNAME}{TAB}{PASSWORD}{ENTER} Auto-Type-Window: Some Dialog - * Auto-Type-1: {USERNAME}{ENTER} Auto-Type-Window-1: * - Editor Auto-Type-Window-1: * - NotePad Auto-Type-Window-1: * - WordPad Auto-Type-2: {PASSWORD}{ENTER} Auto-Type-Window-2: Some Web Page - *Here, the
Auto-Type-1
sequence will be used for all Auto-Type-Window-1
windows.
What exactly is an auto-type keystroke sequence? This is simply a one-line string, which can have placeholders and special key codes.
Above you've seen already that the
default auto-type is {USERNAME}{TAB}{PASSWORD}{ENTER}
. Here,
{USERNAME}
and {PASSWORD}
are placeholders: when auto-type
is performed, these are replaced by the appropriate field values of the entry.
{TAB}
and {ENTER}
are special key codes: these are replaced
by the appropriate keypresses. Special key codes are the only way to specify special
keys like Arrow-Down, Shift, Escape, etc.
Of course, keystroke sequences can also contain simple characters to be sent.
For example, the following string is perfectly valid as keystroke sequence string:
{USERNAME}{TAB}Some text to be sent!{ENTER}
.
KeePass supports the following placeholders:
Field | Placeholder |
---|---|
Title | {TITLE} |
User Name | {USERNAME} |
URL | {URL} |
Password | {PASSWORD} |
Notes | {NOTES} |
Referencing fields of other entries:
KeePass ≥ 1.11 and ≥ 2.05 can also insert data stored in different
entries. For this, the following
placeholder syntax can be used:
{REF:<WantedField>@<SearchIn>:<Text>}
The WantedField and SearchIn parts need to be replaced by
1-letter codes identifying the field: T = title, U = user name, P = password,
A = URL, N = notes, I = UUID. In KeePass 2.x additionally O = other custom
strings (i.e. all string fields). The Text part is the search string, i.e. this text
must occur in the specified field of an entry to match.
Example. You have two entries: one with title "Mozilla Website"
and one with "Mozilla Forums", and want to insert the user name
of the website account into the URL of the forums entry. Within the forum entry's
URL, you could reference the user name like this:
http://fictitious-forum.mozilla.org/?user={REF:U@T:Mozilla Website}
If multiple entries match the specified search criterion, the first
entry will be used. To avoid ambiguity, you can reference entries using their
UUIDs, which are unique. Example:
{REF:P@I:46C9B1FFBD4ABC4BBB260C6190BAD20C}
would insert the
password of the entry having 46C9B1FFBD4ABC4BBB260C6190BAD20C as UUID.
Special Keys:
The following codes for special keys are supported:
Special Key | Code |
---|---|
Tab | {TAB} |
Enter | {ENTER} or ~ |
Arrow Up | {UP} |
Arrow Down | {DOWN} |
Arrow Left | {LEFT} |
Arrow Right | {RIGHT} |
Insert | {INSERT} or {INS} |
Delete | {DELETE} or {DEL} |
Home | {HOME} |
End | {END} |
Page Up | {PGUP} |
Page Down | {PGDN} |
Backspace | {BACKSPACE}, {BS} or {BKSP} |
Break | {BREAK} |
Caps-Lock | {CAPSLOCK} |
Escape | {ESC} |
Help | {HELP} |
Numlock | {NUMLOCK} |
Print Screen | {PRTSC} |
Scroll Lock | {SCROLLLOCK} |
F1 - F16 | {F1} - {F16} |
Keypad + | {ADD} |
Keypad - | {SUBTRACT} |
Keypad * | {MULTIPLY} |
Keypad / | {DIVIDE} |
Shift | + |
Control | ^ |
Alt | % |
Special Key | Code |
---|---|
Space | {SPACE} |
+ | {PLUS} |
@ | {AT} |
% | {PERCENT} |
Apps | {APPS} |
^ | {CARET} |
~ | {TILDE} |
{, } | {LEFTBRACE}, {RIGHTBRACE} |
(, ) | {LEFTPAREN}, {RIGHTPAREN} |
Windows Key: Left, Right | {LWIN} {RWIN} |
Windows Key | {WIN} (equ. to LWIN) |
Windows Key | @ |
Additionally, some special commands are supported:
Command Syntax | Action |
---|---|
{APPDIR} | Will be replaced by the current application directory path. |
{DELAY X} | Delays X milliseconds. |
{INTERNETEXPLORER} | Will be replaced by the path of Internet Explorer, if installed. |
{FIREFOX} | Will be replaced by the path of Mozilla Firefox, if installed. |
{OPERA} | Will be replaced by the path of Opera, if installed. |
Command Syntax | Action |
---|---|
{CLEARFIELD} | Clears the contents of the edit control that currently has the focus (only single-line edit controls). |
{VKEY X} | Sends the VKEY of value X. |
{BEEP X Y} | Beeps with a frequency of X and a duration of Y milliseconds. |
{DELAY=X} | Sets the default delay to X milliseconds for all following keypresses. Deprecated, use standard delay instead. |
{APPACTIVATE WindowTitle} | Activates the window "WindowTitle". |
Finally, some examples:
{TITLE}{TAB}{USERNAME}{TAB}{PASSWORD}{ENTER}
Types the entry's title, a tab, the user name, a tab and the password of the currently selected entry.
{TAB}{PASSWORD}{ENTER}
Presses the tab key, enters the entry's password and presses return.
{DELAY=50}{WIN}{UP}{UP}{UP}{ENTER}notepad{ENTER}
Start Notepad.
Toggling Checkboxes:
Sometimes you find checkboxes on websites ("Stay logged in on this computer" for example).
You can toggle these checkboxes by sending a space character (' '
)
when auto-typing. For example:
{USERNAME}{TAB}{PASSWORD}{TAB} {TAB}{ENTER}
If there is a webform with a user name field, password field and a checkbox, this sequence would
enter the user name, the password and toggle the checkbox that follows the password control.
Higher ANSI Characters:
The auto-type function supports sending of higher ANSI characters in range 126-255. This
means that you can send special characters like ©, @, etc. without any problems:
simply write them directly into the keystroke sequence definition.
When creating a custom window/sequence association, you need to tell KeePass how the matching window titles look like. Here, KeePass supports simple wildcards:
String with Wildcard | Meaning |
---|---|
STRING | Matches all window titles that are named exactly "STRING". |
STRING* | Matches all window titles that start with "STRING". |
*STRING | Matches all window titles that end with "STRING". |
*STRING* | Matches all window titles that have "STRING" somewhere in the window title. This includes the string being directly at the start or at the end of the window title. |
Other wildcards aren't supported. The * wildcard must not be in the middle of a string.
For example, this is invalid: "*Windows*Explorer*
".
This won't match "Windows Explorer
",
it will only match "Windows*Explorer
",
i.e. the middle * character is treated as '*' character instead of a wildcard.
By using wildcards, you can make your auto-type associations browser-independent. See the usage examples for more information.
The default auto-type sequence (i.e. the one which is used when you don't specify
a custom one) is {USERNAME}{TAB}{PASSWORD}{ENTER}
. KeePass allows you
to change this default sequence. Normally you won't need to change it (use
custom window/sequence definitions instead!), but it is quite useful when some
other application is interfering KeePass (for example a security software that
always asks you for permission before allowing KeePass to auto-type).
KeePass.ini
configuration file and set the KeeDefaultAutoTypeSequence
string
(add it, if it doesn't exist yet) to your favorite sequence.Now let's have a look at a real-world example: logging in at PayPal. In this example, will we use the global auto-type hot key to fill out the webpage. Create an entry for PayPal (it should have the title "PayPal").
Let's assume the global auto-type hot key is set to Ctrl-Alt-A (the default). KeePass is running in the background, you have opened your database and the workspace is unlocked.
When you now navigate to the PayPal website and are being prompted for your user name and password, just click into the user name field and press Ctrl-Alt-A. KeePass enters the user name and password for you! Can it be easier?
Why did this work? The window title of your browser window was "PayPal - Welcome - Internet Explorer" or "PayPal - Welcome - Mozilla Firefox", depending on the browser you are using. Because we gave the entry in KeePass the title PayPal, the entry title is contained in the window title, therefore KeePass uses this entry.
Here you already see the huge advantages of auto-type: it not only doesn't require any additional browser software (the browser knows nothing of KeePass -- there are no helper browser plugins required), it is also browser-independent: the one entry that you created within KeePass works for Internet Explorer and Mozilla Firefox (and other browsers) without requiring any modifications or definitions.
When you would use window/sequence associations, you can achieve the same
browser-independent effect using wildcards: you could for example have used
PayPal - Welcome - *
as window filter: this filter matches both
the Internet Explorer and the Firefox window.