# Trigger a mouse click (not on a button)

**URL:** <https://forum.inductiveautomation.com/t/trigger-a-mouse-click-not-on-a-button/18299>\
**Category:** Ignition\
**Created:** [June 5, 2018, 5:12pm UTC](https://forum.inductiveautomation.com/t/trigger-a-mouse-click-not-on-a-button/18299 "2018-06-05T17:12:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 5, 2018, 5:36pm UTC](https://forum.inductiveautomation.com/t/trigger-a-mouse-click-not-on-a-button/18299/2 "2018-06-05T17:36:43Z")

</div>

You can create a mouse event from scratch, copying the relevant information from the original event. Something like this, but dispatched on event.source:

> [@Button Events Within Templates](http://forum.inductiveautomation.com/t/button-events-within-templates/14382/17):
>
> 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…

---

_[View the full topic](https://forum.inductiveautomation.com/t/trigger-a-mouse-click-not-on-a-button/18299)._
