Light pen
From Computer History Wiki
The light pen (called the light gun in its initial implementation) was an early pointing device used with a graphical user interface.
It was invented on the Whirlwind computer when early experience with a joystick showed that it was slow and difficult to zero in on a selected item.
The initial implementation was simply a light-sensitive sensor, a phototube, connected to the computer; it was held up to the CRT display. When the beam illuminated the spot on the screen in front of the light gun, it produced a pulse from the sensor, which the computer could detect, and correlate with the current location of the beam.
Later implementations used a smaller sensor in a pen-sized housing, hence the later name.