I am making a text-based game with frames, and my problem right now is that I have the code to check for keypresses
key = getkey.getkey()
But it seems like that command waits for you to press a key to continue with the code (that is, the command is blocking), and I would just like the game to continue updating, even if you don't press a key.
I was thinking of something like this:
import getkey
##Rest of my code
if key_pressed(any):
key = getkey.getkey()
I'm using the getkey library, and I'm on the Replit webapp if that helps. I can't use something like msvcrt because I am on Linux.
getkey.getkeyhas ablockingkwarg. I'm not really sure how it works though; setting it toTrueseems to have made the function do literally nothing in my initial testing.API There is one primary method: getkey(blocking=True)so I'll check if it works. EDIT: It doesn't.