You can create a mouse event from scratch, copying the relevant information from the original event. Something like this, but dispatched on event.source:
Here is how I do it.
from java.awt.event import MouseEvent
evt = MouseEvent(event.source.parent.parent,event.getID(),event.getWhen(),event.getModifiers(),event.x,event.y,event.clickCount,event.popupTrigger,event.button)
event.source.parent.parent.dispatchEvent(evt)
We take the originating event, from a label inside the template, and create a new instance of the mouse event, only changing the source. If we do not do this, then event.source will be equal to the triggering component inside the t…