1. A mobile terminal comprising: a main device; at least one sub-device configured to be attached to and detached from the main device such that the sub-device has an attached configuration and a detached configuration; and a controller configured to determine whether the at least one sub-device is in the detached configuration or the attached configuration, receive a user input from the at least one sub-device via a specific communication path when the at least one sub-device is in the detached configuration and control at least one function of the terminal according to the user input.