A portable electronic device, comprising: a first display module; a second display module, pivotally connected to the first display module; a keyboard device; a sensing unit, configured to sense a position of the keyboard device relative to the second display module in a magnetic manner so as to output a sensing signal, wherein the keyboard device is disposed on a second displaying screen of the second display module; and a control unit, configured to control a displaying image of the second display module according to the sensing signal; wherein the second display module further comprises: a housing, having an inner side; a sliding module, disposed within the housing, wherein the keyboard device is configured to drive the sliding module to move; and a positioning assembly configured to position the sliding module at different positions within the housing; wherein the sliding module comprises: a sliding track, disposed in the housing and being parallel to the inner side; a sliding member, disposed on the sliding track, wherein the sliding member is configured to slide along the sliding track; wherein the portable electronic device further comprises a limiting structure configured to limit a relative position of the keyboard device and the sliding module; wherein the limiting structure comprises: a first magnet, disposed on the sliding module; and a second magnet, corresponding to the first magnet, wherein the second magnet is disposed on the keyboard device and is configured to generate a magnetic attracting force so as to limit the relative position of the keyboard device and the sliding module. a first display module; a second display module, pivotally connected to the first display module; a keyboard device; a sensing unit, configured to sense a position of the keyboard device relative to the second display module in a magnetic manner so as to output a sensing signal, wherein the keyboard device is disposed on a second displaying screen of the second display module; and a control unit, configured to control a displaying image of the second display module according to the sensing signal; wherein the second display module further comprises: a housing, having an inner side; a sliding module, disposed within the housing, wherein the keyboard device is configured to drive the sliding module to move; and a positioning assembly configured to position the sliding module at different positions within the housing; wherein the sliding module comprises: a sliding track, disposed in the housing and being parallel to the inner side; a sliding member, disposed on the sliding track, wherein the sliding member is configured to slide along the sliding track; wherein the portable electronic device further comprises a limiting structure configured to limit a relative position of the keyboard device and the sliding module; wherein the limiting structure comprises: a first magnet, disposed on the sliding module; and a second magnet, corresponding to the first magnet, wherein the second magnet is disposed on the keyboard device and is configured to generate a magnetic attracting force so as to limit the relative position of the keyboard device and the sliding module. a housing, having an inner side; a sliding module, disposed within the housing, wherein the keyboard device is configured to drive the sliding module to move; and a positioning assembly configured to position the sliding module at different positions within the housing; wherein the sliding module comprises: a sliding track, disposed in the housing and being parallel to the inner side; a sliding member, disposed on the sliding track, wherein the sliding member is configured to slide along the sliding track; wherein the portable electronic device further comprises a limiting structure configured to limit a relative position of the keyboard device and the sliding module; wherein the limiting structure comprises: a first magnet, disposed on the sliding module; and a second magnet, corresponding to the first magnet, wherein the second magnet is disposed on the keyboard device and is configured to generate a magnetic attracting force so as to limit the relative position of the keyboard device and the sliding module. a sliding track, disposed in the housing and being parallel to the inner side; a sliding member, disposed on the sliding track, wherein the sliding member is configured to slide along the sliding track; wherein the portable electronic device further comprises a limiting structure configured to limit a relative position of the keyboard device and the sliding module; wherein the limiting structure comprises: a first magnet, disposed on the sliding module; and a second magnet, corresponding to the first magnet, wherein the second magnet is disposed on the keyboard device and is configured to generate a magnetic attracting force so as to limit the relative position of the keyboard device and the sliding module. a first magnet, disposed on the sliding module; and a second magnet, corresponding to the first magnet, wherein the second magnet is disposed on the keyboard device and is configured to generate a magnetic attracting force so as to limit the relative position of the keyboard device and the sliding module.