How to sense a keystroke?

I want a value sent to a property only when a key is held down, and then returned to 0 when the key is released.

For example: I have a property, “turn”, with an initial value of “0”. When the LEFT arrow key is pressed, “turn” should have a value of “-1”. When it is released, the value of “turn” should return to “0”.

How do I do this? Any hints?

here i made a sample (im not good at explaining things) :stuck_out_tongue:

note the use of the ‘inv’ button on the second keyboard sensor

http://hyperupload.com/download/d85f3052/turn.blend.html

Perfect!

Thanks!