Added detect touch function to easily add touch event for an object, for example for a button