When you open the tray of a CDROM drive and push back against the tray, it will close at a certain point. Also, when the tray is opened completely, you can close it by pushing back against the tray.
I've taken apart several CDROM drives by now, but I've never found any sort of mechanism that senses whether or not someone presses against the tray. Perhaps I missed it.
Can somebody tell me what kind of sensor or circuitry (if any) is used for this?