To answer your question - the key event has four status:
bge.logic.KX_INPUT_NONE
bge.logic.KX_INPUT_JUST_ACTIVATED
bge.logic.KX_INPUT_ACTIVE
bge.logic.KX_INPUT_JUST_RELEASED
Try this in your file (always sensor true level triggering enabled):
import bge
keyboard = bge.logic.keyboard
w_key_status = keyboard.events[bge.events.WKEY]
if w_key_status == bge.logic.KX_INPUT_NONE:
print("not pressed")
elif w_key_status == bge.logic.KX_INPUT_JUST_ACTIVATED:
print("just pressed")
elif w_key_status == bge.logic.KX_INPUT_ACTIVE:
print("hold")
elif w_key_status == bge.logic.KX_INPUT_JUST_RELEASED:
print("just released")
else:
print("You should never see this message. There are no other status")
When you read the console output carefully you can guess what you need to check. If not let us know.