Method for performing a function and device for providing the same

Electronic device according to one embodiment of the present invention is an input interface for receiving an input based on the physical deformation of the auxiliary device from the secondary device; A processor for controlling the electronic device to perform a predefined function or if included in the input detect signal generated based on the input, and a sensed signal meets a predetermined condition; And it may include a memory that stores information related to the predetermined condition. However, it is possible to include other embodiments not limited to the above-described embodiment