Patent ID: 8242389

Claim:
A portable electronic device, comprising: a main body having a containing slot; a stylus suitable for being inserted into the containing slot; and a switch disposed at a side of the containing slot and electrically connected to the main body; a swinging member disposed between the containing slot and the switch, wherein a center portion of the swinging member is pivoted on the main body, a first end of the swinging member is located in the containing slot, and the switch is disposed at a second end of the swinging member, when the stylus is inserted into the containing slot, the stylus pushes the first end of the swinging member to swing, and the second end of the swinging member presses the switch; and when the stylus is taken out from the containing slot, the swinging member returns to an initial position to release the switch so as to enable the main body to execute a presetting function.