Patent attributes
An electronic device may be provided with a touch screen display that is controlled based on information from a proximity sensor. The proximity sensor may have a light source that emits infrared light and a light detector that detects reflected infrared light. When the electronic device is in the vicinity of a user's head, the proximity sensor may produce data indicative of the presence of the user's head. Variations in proximity sensor output due to user hair color and smudges on the proximity sensor can be accommodated by using an electrical sensing mechanism in addition to the light sensing mechanism. The proximity sensor may include a pair of capacitive electrodes for generating an electric field in the vicinity of the device. The presence of a user's head can sufficiently disturb the electric field so as to produce data indicative of the presence of the user's head.