An electronic device comprising: a display disposed in a first housing; an input device comprising input circuitry disposed in a second housing arranged to face the display device, wherein the first and second housing are rotatively connected; a first sensor module disposed in the first housing; a second sensor module disposed in the second housing; a communication module comprising communication circuitry for connecting to an external electronic device; and a processor electrically connected with the display, the input device, the first sensor module and the second sensor module, the processor configured to: determine whether sensing data provided by the first sensor module and sensing data provided by the second sensor module meet a predetermined condition, and operate the input device in an external input mode if the sensing data provided by the first sensor and the sensing data provided by the second sensor meet the predetermined condition, wherein the processor is configured to switch a transmission path of a user input signal received by the input device from a first path, where the user input signal is processed by the electronic device, to a second path, where the user input signal is delivered to the communication module for being delivered to the external electronic device, if the input device is switched from a normal input mode to the external input mode. a display disposed in a first housing; an input device comprising input circuitry disposed in a second housing arranged to face the display device, wherein the first and second housing are rotatively connected; a first sensor module disposed in the first housing; a second sensor module disposed in the second housing; a communication module comprising communication circuitry for connecting to an external electronic device; and a processor electrically connected with the display, the input device, the first sensor module and the second sensor module, the processor configured to: determine whether sensing data provided by the first sensor module and sensing data provided by the second sensor module meet a predetermined condition, and operate the input device in an external input mode if the sensing data provided by the first sensor and the sensing data provided by the second sensor meet the predetermined condition, wherein the processor is configured to switch a transmission path of a user input signal received by the input device from a first path, where the user input signal is processed by the electronic device, to a second path, where the user input signal is delivered to the communication module for being delivered to the external electronic device, if the input device is switched from a normal input mode to the external input mode. determine whether sensing data provided by the first sensor module and sensing data provided by the second sensor module meet a predetermined condition, and operate the input device in an external input mode if the sensing data provided by the first sensor and the sensing data provided by the second sensor meet the predetermined condition, wherein the processor is configured to switch a transmission path of a user input signal received by the input device from a first path, where the user input signal is processed by the electronic device, to a second path, where the user input signal is delivered to the communication module for being delivered to the external electronic device, if the input device is switched from a normal input mode to the external input mode.