Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
3

Python arrow key input

JakobNacanaynay
JakobNacanaynay

How to you get python to detect an arrow key? How do you make it react immediately without having to press ENTER.

4 years ago

Voters

Comments

TopNew
2
Barry123
Barry123

If you are using turtle:
Import turtle
screen=turtle.Screen()
#Define a function here
while True:
screen.onkey(That_function, key)

2 years ago
1
ColePete
ColePete

If I could see you code, that would be helpful. But, you could just have it print("insert something here") again. Or, you can use time and tell it to wait a few seconds, and then continue. If you give me the code, I could show you.

@JakobNacanaynay

2 years ago
1
Four_Of_Clubs
Four_Of_Clubs

I know this is like super late, but the onkey() function is what you are looking for. There are some other steps though, so it might help to look at the code made by other people and use the power of google to help.

4 years ago
2
JakobNacanaynay
JakobNacanaynay

@Four_Of_Clubs thanks

4 years ago
1
E-Sheep
E-Sheep

@Four_Of_Clubs It works only when you import turtle right?

2 years ago
0
skyscraper1492
skyscraper1492

Hmmm. I was also trying to use arrow keys. But it didn't work for me either.

2 years ago
Load more