An electronic device comprising: a sensing panel; communication circuitry; at least one processor electrically connected to the sensing panel and the communication circuitry; and a memory electrically connected to the at least one processor, wherein the memory is configured to store instructions, when executed by the at least one processor, cause the electronic device to: receive (707, 807), through the communication circuitry from a stylus pen at least one communication signal, wherein the at least one communication signal includes information on a position of the stylus pen and information relating to a gesture start event, identify (701, 801) the gesture start event based on the information related to the gesture start event included in the received at least one communication signal; identify (703, 803) whether a pen signal from the stylus pen is detected through the sensing panel; when it is identified that the pen signal from the stylus pen is detected through the sensing panel: perform (705, 805) a first operation identified based on the detected pen signal identified through the sensing panel and ignore the information on the position of the stylus pen included in the received at least one communication signal, and when no pen signal from the stylus pen is detected through the sensing panel: identify (709, 811) a gesture based on the information on the position of the stylus pen included in the received at least one communication signal, and perform (711, 813) a second operation, different from the first operation, corresponding to the identified gesture. a sensing panel; communication circuitry; at least one processor electrically connected to the sensing panel and the communication circuitry; and a memory electrically connected to the at least one processor, wherein the memory is configured to store instructions, when executed by the at least one processor, cause the electronic device to: receive (707, 807), through the communication circuitry from a stylus pen at least one communication signal, wherein the at least one communication signal includes information on a position of the stylus pen and information relating to a gesture start event, identify (701, 801) the gesture start event based on the information related to the gesture start event included in the received at least one communication signal; identify (703, 803) whether a pen signal from the stylus pen is detected through the sensing panel; when it is identified that the pen signal from the stylus pen is detected through the sensing panel: perform (705, 805) a first operation identified based on the detected pen signal identified through the sensing panel and ignore the information on the position of the stylus pen included in the received at least one communication signal, and when no pen signal from the stylus pen is detected through the sensing panel: identify (709, 811) a gesture based on the information on the position of the stylus pen included in the received at least one communication signal, and perform (711, 813) a second operation, different from the first operation, corresponding to the identified gesture. receive (707, 807), through the communication circuitry from a stylus pen at least one communication signal, wherein the at least one communication signal includes information on a position of the stylus pen and information relating to a gesture start event, identify (701, 801) the gesture start event based on the information related to the gesture start event included in the received at least one communication signal; identify (703, 803) whether a pen signal from the stylus pen is detected through the sensing panel; when it is identified that the pen signal from the stylus pen is detected through the sensing panel: perform (705, 805) a first operation identified based on the detected pen signal identified through the sensing panel and ignore the information on the position of the stylus pen included in the received at least one communication signal, and when no pen signal from the stylus pen is detected through the sensing panel: identify (709, 811) a gesture based on the information on the position of the stylus pen included in the received at least one communication signal, and perform (711, 813) a second operation, different from the first operation, corresponding to the identified gesture. perform (705, 805) a first operation identified based on the detected pen signal identified through the sensing panel and ignore the information on the position of the stylus pen included in the received at least one communication signal, and when no pen signal from the stylus pen is detected through the sensing panel: identify (709, 811) a gesture based on the information on the position of the stylus pen included in the received at least one communication signal, and perform (711, 813) a second operation, different from the first operation, corresponding to the identified gesture.