You can import a ready-made example from here https://eu.eyeauras.net/share/S20240224004118uKKy4R0wIpLd
HotkeyIsActive to it and bind it to a convenient button (this will be our on/off switch, in the example F2), change the activation type to Click/Hold.C# Script action to the On Enter event.F2 will print several lines of text.
var sendInputApi = GetService<ISendInputUnstableScriptingApi>(); 
sendInputApi.Text("Hello, world!"); // printing with the standard interval (random, 1-5ms)
sendInputApi.KeyPressDelay = new RandomInteger(5, 15); // changing the interval to 5-15ms
sendInputApi.Text("\nthis one is a bit slower"); 
sendInputApi.Text("\nand this one is very slow!", delayMs: 30); // printing with a 30ms interval
In the example, the special character
\nis specified at the beginning of the lines, which is a line break character.