This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local masterTouch | |
local function cancelTouch() | |
if masterTouch then | |
print( "\nTouch event phase before cancellation: " .. masterTouch.phase ) | |
-- You could include a unique property to know that the event was terminated via this function. | |
-- masterTouch.terminated = true | |
masterTouch.phase = "cancelled" -- Change the event phase before faking the touch event. | |
masterTouch.target.listener( masterTouch ) | |
-- Setting isTouched property back to false will prevent the touch listener from firing again |