Photoelectric sensor with Teach Mode?

Hi,

I'm working on a project that is supposed to simulate a hockey face off vs the computer. The idea is to have a sensor in the floor that determine when the player has swung the stick. I found this:

http://www.clrwtr.com/PDF/SUNX/SUNX-CY-Series-Photoelectric-Sensors.pdf

and I am curious about how the teach mode works. Also, is this the best component for the job.

I was looking into proximity sensors too.

http://www.clrwtr.com/PDF/TURCK/TURCK-M18-Metal-Threaded.pdf

Teach mode? What are you referring to? Link? Will probably be something you, yourself, will have to program for.

Paul