An electronic device, comprising: communication circuitry; at least one memory storing instructions; a display; a touch screen; and at least one processor, wherein the at least one processor, when executing the instructions, is configured to: execute an application, transmit, using the communication circuitry, user interface information to an external device, wherein the external device is configured to display a first user interface of the application based on the user interface information, while the first user interface is displayed by the external device, receive a specified input, and in response to receiving the specified input, display, on the display of the electronic device, a virtual touch pad in a first area and a virtual keyboard in a second area distinct from the first area, and while displaying the virtual touch pad in the first area and the virtual keyboard in the second area, receive a drag input starting in the first area; and characterized in that: the processor is further configured, in response to identifying that the drag input is directed from the first area toward the second area while the contact of the drag input is maintained, to move the virtual keyboard to preclude contact between the drag input and the virtual keyboard. communication circuitry; at least one memory storing instructions; a display; a touch screen; and at least one processor, wherein the at least one processor, when executing the instructions, is configured to: execute an application, transmit, using the communication circuitry, user interface information to an external device, wherein the external device is configured to display a first user interface of the application based on the user interface information, while the first user interface is displayed by the external device, receive a specified input, and in response to receiving the specified input, display, on the display of the electronic device, a virtual touch pad in a first area and a virtual keyboard in a second area distinct from the first area, and while displaying the virtual touch pad in the first area and the virtual keyboard in the second area, receive a drag input starting in the first area; and characterized in that: the processor is further configured, in response to identifying that the drag input is directed from the first area toward the second area while the contact of the drag input is maintained, to move the virtual keyboard to preclude contact between the drag input and the virtual keyboard. execute an application, transmit, using the communication circuitry, user interface information to an external device, wherein the external device is configured to display a first user interface of the application based on the user interface information, while the first user interface is displayed by the external device, receive a specified input, and in response to receiving the specified input, display, on the display of the electronic device, a virtual touch pad in a first area and a virtual keyboard in a second area distinct from the first area, and while displaying the virtual touch pad in the first area and the virtual keyboard in the second area, receive a drag input starting in the first area; and characterized in that: the processor is further configured, in response to identifying that the drag input is directed from the first area toward the second area while the contact of the drag input is maintained, to move the virtual keyboard to preclude contact between the drag input and the virtual keyboard.