How do I detect if a specific keyboard button has been released in BGE python 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