Patent ID: 8537130

Claim:
A portable electronic device, comprising: a touch screen; a memory; at least one processor; a detection circuit operable to detect a voltage indicating whether a stylus is received in a receiving space of the portable electronic device, wherein the detection circuit comprises a switch that is activated when the stylus is received in a receiving space of the portable electronic device, and is inactive when the stylus is not received in the receiving space; and a General Purpose Input/Output (GPIO) pin that is grounded in response to the switch being active, and the GPIO pin is set at a high voltage in response to the switch being inactive; an analog/digital converter operable to transform the voltage into a corresponding logic value; one or more programs that are stored in the memory and are executed by the at least one processor, the one or more programs comprising: a receiving module operable to receive the logic value; a detection module operable to detect whether the voltage is changed from a low voltage to a high voltage according to the logic value; and an unlocking module operable to control the at least one processor to unlock or wake up the portable electronic device if the voltage is changed from a low voltage to a high voltage.