How do i detect keypresses in codecombat?

You should be able to take the input key as an argument.[1]

def heroJump(event)
    if event.key == "q": #if the key is "Q" for example

I don’t even know Python very well, so please respond if this doesn’t work.


  1. ↩︎