automating with AutoKey
see also autokey app
https://linuxhint.com/autokey_automate_linux_games/#comment-416 :
This is do-able but you may need additional tools, mainly xdotool
The way keyboard input works on Linux, repeating keys may be turned off automatically when you press any other key.
You can also use the AutoKey app mentioned in the article.
But in-case repeat mode is not interrupted when you press any other key, you can try using the “xinput” command to disable keyboard and then re-enable it by running two consecutive commands in a script.
The documentation : https://github.com/autokey/autokey/wiki has some example scripts.
voorbeelden
https://askubuntu.com/questions/529078/how-to-create-an-autokey-script-that-pastes-from-clipboard