1. Light-Emitting Diodes (LEDs): Optical pens have a small light-emitting diode (LED) at their tip. When the pen touches the screen, the LED emits a beam of light.
2. Photodetector: Inside the pen, there's a photodetector that is sensitive to light. When the light emitted from the pen's LED reflects off the screen and reaches the photodetector, it is converted into an electrical signal.
3. Signal Processing: The electrical signal generated by the photodetector is processed by the computer system to determine the exact position of the pen's tip on the screen.
4. Cursor Control: The computer's software then interprets the pen's position and uses it to control the movement of the cursor or pointer on the display.
5. Selection and Interaction: By clicking a button on the optical pen, the user can select items or perform various actions on the screen. For instance, they can draw shapes, write letters, or select objects.
Optical pens were popular in the early days of computing, especially with graphical user interfaces (GUIs). However, they have been largely replaced by more modern input devices such as mice and touchscreens, which offer better precision and a wider range of functionalities.