Method, device and mobile terminal for setting key function

The invention discloses a method, device and mobile terminal for setting the key function, and belongs to the technical field of terminals. The method comprises the steps that when insertion of a pair of earphones is detected, the key function of an earphone key is obtained; function setting options of the earphone key are provided; when the selecting operation of any function in the function setting options is detected, the earphone key is relevant to the function corresponding to the selecting operation, and the key can trigger the function. According to the method, device and mobile terminal for setting the key function, due to the fact that the function setting options of the earphone key are provided, the earphone key can be relevant to the function selected by a user, the mobile terminal is applicable to the earphones of various styles, the user-defined earphone key function is achieved, and the user can conveniently control the mobile terminal.