I want to know how to detect if a keyboard button has been released in the blender game engine using python, not logic bricks.

So I use this code to detect if a keyboard button is pressed

    if (bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.WKEY]):

So that right there detects if the "W" key is pressed, but what if I wanted to detect if the "W" key was released, rather than pressed?


1 Answer 1


You check for bge.logic.KX_INPUT_JUST_RELEASED


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .