This is very useful when working with VPSes where you can’t paste into the VNC connection (maybe I’m doing something wrong and you can?).
Below is a quick piece of code I use. This should be ran as the user and not root. This sleeps for 5 seconds so you can navigate to where you need.
sleep 5s; xdotool type CODE_TO_TYPE_HERE