Photoelectric sensor with Teach Mode?


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:

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.

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