Now, we have created a new kind of event, so it is possible to attach callback methods to our new event as we have in the predefined events. For this recipe, we will create a new event and attach a callback function to it. If the button text changes, the event as in the past recipe will be fired.
We will use the code from the previous recipe as the base of this recipe and will add a different touch so that we can change the button when it is double tapped. Hence, I would advise you to go through the previous recipe again. Also, the reader may find the section on multitouching from Chapter 2, Input, Motion, and Touch useful specifically.