Proximity switches?

I’ve recently purchased the PS3 game, LittleBigPlanet, and it was pretty good. What I was wondering, If someone could code a “Proximity Switch” That would have 2 basic parts: The key, and the switch. When the key is moved within a certain radius of the switch, the switch would activate. IE: Switch connected to light, key moved to switch, light turns on.

Simple idea, but I am not exactly sure if it has been done before. Has it?

Wiremod.

Target finder, light, multiply, constant value.