keyboard "keyhold' RECOGNITION

Hi, i have two objects, when holding down a key on the key board, I wish to make one appear, and the other disapear. Then, when the key is released, they go back to their original states…(basically swapping visibility whenever a key is pressed or released). I have tried mucking round with the keypress action and visibilities…but I cant seem to get the objects to “hold” their state during the duration of the key hold.

Thanx in advance for your help!

here is a small example!

Attachments

show hide.blend (168 KB)

Have a keyboard sensor with true pulse mode on connected to the visibility actuator. Make another keyboard sensor with true pulse mode on, but set it to invert. Connect that to the invisible actuator. Switch those around for the other object.