A method of processing data in a system comprising a digital device, a first external device (120, 130) and a remote control device, the method comprising: executing a first application in the digital device; receiving, via a user input interface included in the digital device, a signal for requesting a keyboard from the remote control device; outputting a list of paired external devices (120, 130); obtaining priority data of the paired external devices (120, 130) from a storage unit, the priority data related to providing the keyboard; identifying a first external device with higher priority for providing a keyboard than the digital device from the list based on the obtained priority data; determining whether the first external device is positioned within a predetermined range of the digital device; transmitting a first control command for requesting keyboard input data to the first external device; wherein, when the first external device is not within the predetermined range, the first control command comprises data about the first application currently executing on the digital device; and receiving keyboard input data from the first external device (120, 130); outputting the keyboard input data received from the first external device (120, 130) on the digital device; performing an operation based on the output keyboard input data; and terminating keyboard input, wherein, when the first control command is received by the first external device (120, 130) from the digital device while the first external device (120, 130) is executing a second application and is providing a keyboard and a window for the second application, the method further comprises the steps of: providing a User Interface, UI, on the first external device indicating the request of keyboard input data, displaying an input stack bar on a screen of the first external device (120, 130) in response to receiving of the first control command, displaying a first icon and a second icon on the input stack bar with respect to the first application and the second application for which the keyboard is used, in response to selecting the first icon, changing the window of the second application to a window for providing the data about the first application currently executed in the digital device and transmitting the keyboard input data to the digital device; and in response to selecting the second icon, providing the keyboard only for the second application. executing a first application in the digital device; receiving, via a user input interface included in the digital device, a signal for requesting a keyboard from the remote control device; outputting a list of paired external devices (120, 130); obtaining priority data of the paired external devices (120, 130) from a storage unit, the priority data related to providing the keyboard; identifying a first external device with higher priority for providing a keyboard than the digital device from the list based on the obtained priority data; determining whether the first external device is positioned within a predetermined range of the digital device; transmitting a first control command for requesting keyboard input data to the first external device; wherein, when the first external device is not within the predetermined range, the first control command comprises data about the first application currently executing on the digital device; and receiving keyboard input data from the first external device (120, 130); outputting the keyboard input data received from the first external device (120, 130) on the digital device; performing an operation based on the output keyboard input data; and terminating keyboard input, wherein, when the first control command is received by the first external device (120, 130) from the digital device while the first external device (120, 130) is executing a second application and is providing a keyboard and a window for the second application, the method further comprises the steps of: providing a User Interface, UI, on the first external device indicating the request of keyboard input data, displaying an input stack bar on a screen of the first external device (120, 130) in response to receiving of the first control command, displaying a first icon and a second icon on the input stack bar with respect to the first application and the second application for which the keyboard is used, in response to selecting the first icon, changing the window of the second application to a window for providing the data about the first application currently executed in the digital device and transmitting the keyboard input data to the digital device; and in response to selecting the second icon, providing the keyboard only for the second application. providing a User Interface, UI, on the first external device indicating the request of keyboard input data, displaying an input stack bar on a screen of the first external device (120, 130) in response to receiving of the first control command, displaying a first icon and a second icon on the input stack bar with respect to the first application and the second application for which the keyboard is used, in response to selecting the first icon, changing the window of the second application to a window for providing the data about the first application currently executed in the digital device and transmitting the keyboard input data to the digital device; and in response to selecting the second icon, providing the keyboard only for the second application.