Is there a way to get input outside the program?

I want to make a program that gives input outside of it, like an autoclicker. Is that even possible?
(dont-hate-me-for-this-stupid-question-pls)

That would be extremely dangerous, so luckily, no.

There is another took that can do what you want: