ugh. searching "how do I do xdotool type stuff with wayland" and one of the first results is "No, such features were explicitly excluded from the Wayland design for security reasons."
everyone who thinks "I know, I'll make computers not automatable, that'll make them more secure!" has fundamentally misunderstood what computers are for
the most secure computer is one that's not turing complete

I've said it before and I'll say it again:
there is one and only one way to reliably script keyboard/mouse input:

a USB microcontroller.

@foone fair. But far from the most convenient.