How do you type? I get the ydotool usage but do you have a shortcut for each key then on your phone?
So I just press a button from my quick select and then it'll send my text followed by a carriage return (depending on which option I use).
On Android I did something very similar using termux but it only took 2 minutes to write and is much easier to understand and use