Based on Jasper123 great script the events of the long_press, double etc can be placed in a automation. For me it was not clear how to trap these events but I finally understood his comments.
Here is screenshot of how it listen to these events.
Hope that helps somebody else.