Ask coding questions

← Back to all posts
I need some help with the getkey module
noway15 (90)

I'm working on a smallish program and I've decided to try my hand at the GetKey module.

Unfortunately, I've encountered a bit of a problem with the module. I've been trying to accept user input with the arrow keys, but it kinda doesn't work? For example, I put in keys.UP for the up arrow, but it didn't really understand that...? Can somebody help me a bit please?

Answered by btfuss (162) [earned 5 cycles]
View Answer
btfuss (162)

I think you do:

key = getkey()

if key.up:
  #whatever you want

Here is a resource:

noway15 (90)

@btfuss oh I thought it was supposed to be all caps