How can i give a keybord input

Question:
How could i make a program to give a keyboard input? Like i run the code and its like I type something but its all the program. i don’t even know where to start.

What coding language are you using?

If you’re talking about python, x = input("insert question here") sets x to whatever they answer. There’s a couple different ways to get inputs in JS – if that’s what you’re using, let me know

But for python, you have to press enter to go forward, he wants it to be like you press w and the character moves forward.

Generally speaking, if I were to visit a random website and click on a search box, I could activate my program to input text (although this is a simplistic and poor example).

Try searching to use the package pyAutoGUI
It helps to do clicks and typing text on your computer programmatically.

I havent used it personally but my friend used it for a clicker game and said to me

1 Like

Can you advise me on the program necessary to run it? (I’m guessing it won’t work in Replit, but can you confirm?)

It will not work on replit. You have to run it locally.
I could suggest:

  1. Pycharm
  2. Python builtin idle (comes with official python installation)
  3. Use any editor and convert python program to .exe file and run it

Make sure to have a kill switch(for example pressing spacebar stops the program) or else in case of a bug you cant control anything

1 Like

I appreciate your assistance with this. I will download Python and ensure that a kill switch or button is implemented!

You may mark it as solution :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.