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?


You check for bge.logic.KX_INPUT_JUST_RELEASED


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.