Printing Text
Printing Text
Run this top-level C# Action with a working input simulator. Before pressing F2, focus an editor such as Notepad. TargetWindow = null sends to the active application.
You can import a ready-made example from here https://eu.eyeauras.net/share/S20240224004118uKKy4R0wIpLd
- Create an aura.
- Add
HotkeyIsActiveto it and bind it to a convenient button (this will be our on/off switch, in the exampleF2), change the activation type toClick/Hold. - Add a
C# Scriptaction to theOn Enterevent. - Copy and paste the script itself.
- Pressing
F2will print several lines of text.

using EyeAuras.Roxy.Api;
using PoeShared.Scaffolding;
var sendInputApi = GetService<ISendInputScriptingApi>();
sendInputApi.TargetWindow = null;
cancellationToken.ThrowIfCancellationRequested();
sendInputApi.Text("Hello, world!");
sendInputApi.KeyPressDelay = new RandomInteger(5, 15);
sendInputApi.Text("\nthis one is a bit slower");
sendInputApi.Text("\nand this one is very slow!", delayMs: 30);
In the example, the special character
\nis specified at the beginning of the lines, which is a line break character.
Three lines are sent with different delays. Text synchronously waits for sending; without delayMs it uses KeyPressDelay, initially 1–5 ms. These generator delays do not guarantee application display timing. The call has no Run token; the pre-call cancellation check cannot interrupt an active send. For a single key use KeyPress(Key.Enter, keyPressDelay: 30).