Skip to main content

Simulated Key

Simulates key presses while expanding the snippet.

For more information, see Simulating Keys.

iOS Compatibility

iOS doesn't allow to simulate key presses. However, Snippety Keyboard tries to simulate Return and Tab keys by sending \n character.

It's not fully reliable and it depends on the application you are using. However, some apps will switch to the next field when they receive \n, which can be useful when filling forms.

Parameters

1️⃣ Key

The key you want to simulate. It also supports special keys like Space, Enter, and key combinations like CMD + A.

When using UI, you can record the key you want to simulate.

2️⃣ Delay (default: 0.2)

The delay between key presses in seconds.

3️⃣ Repeat (default: 1)

The number of times the key should be pressed.

Syntax

{@key|Space|0.2|3@}

This placeholder will simulate Space key pressed 3 times with a delay of 200ms.

Notes

When Snippety encounters a key, it will first paste the text before the key and then simulate the key press. After that, it will paste the text after the key and repeat the process for the next key if there are more keys in the snippet.

Use Cases

This placeholder is useful when you want to simulate key presses in your snippets. It might be useful when you want to automate some actions in the application you are using.

Example 1

You want to create a snippet that fills a form on a website:

John
{@key|⇥|0.1|1@}
Snow
{@key|⇥|0.1|1@}
Wall Street
{@key|↩|0.1|1@}

Example 2

You want to create a snippet that creates a new file with a specific name and fills it with some content:

{@key|⌘N|0.2|1@}
{@text|File Name@}
{@key|↩|0.5|1@}
{@key|⌘A|0.2|1@}
This is the content of the file.

This example creates a new file with the provided name, selects all text, and fills it with the content.